yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Learn to code in 60 seconds #programming #computerscience #python #khanacademy


less than 1m read
·Nov 10, 2024

Learn to code in 60 seconds. A program is a coded set of instructions for a computer to execute. Programs manipulate data, which come in several data types: integers, that's whole numbers; floats, have decimal points; booleans, true or false; and strings, of characters (don't forget the quotation marks).

Need to store a piece of data for later use? A variable names its location and points to it. Have a bunch of data? Organize it with a data structure. Lists store data in an ordered sequence, but we start counting at an index of zero. Dictionaries associate each piece of data with a key for easy lookup.

To make decisions in a program, ask a question with a Boolean expression. Then, choose which path to take with an if statement. To repeat a code routine, use a loop. A while loop repeats until the answer to your question becomes false. A for loop repeats a fixed number of times.

Have a lot of code? Break it down into smaller tasks with functions. Customize the function with input arguments and call the function to execute its task. Did you catch all that? Take it at your own pace with Khan Academy's intro to computer science course.

More Articles

View All
Paul Giamatti on Human Engineering | Breakthrough
I’m Paul Gatti, and I am directing and doing the interviewing in an episode of Breakthrough called “More Than Human.” It was out of left field for me. I’ve obviously never done anything like this, but a guy that I know was helping produce at David Jacobso…
Photographing America’s Wounded Soldiers in Iraq | Nat Geo Live
In 2004, I got a call from LIFE magazine. They said we have this incredible assignment for you. It’s to photograph the wounded coming out of Fallujah. When we flew in, this is one of the first scenes I saw. This is on my birthday in 2004, and it was durin…
Gordon Ramsay Explores the Medina of Fez | Gordon Ramsay: Uncharted
[Music] I’m in Morocco, North Africa, to discover the hidden colony secrets of this incredible country. I’ve always loved Moroccan food because every bite is steeped in history. Over the centuries, the Arabs, Spanish, Ottomans, and French have all left th…
BIGGEST EXPLOSIONS
Hey, Vsauce. Michael here, and today I’m in my apartment. But when I was in Kansas with family, my dad lit off what is known as a quarter stick. But don’t worry, absolutely no children were around. Okay, look, the point is that today we’re going to talk a…
The truth behind jet lag...
The thing that everybody thinks is jet lag. People think it’s because of the time zone change; it really is not the time zone change. It’s the cabin altitude of the plane. If you ever go skiing and you go to a place that’s at 2500 or 3,000 M, and the fir…
Go with what you can get started on most quickly. And get that first user.
Here’s a question: I have lots of startup ideas. How do I choose the one to work on? Uh, common problem. There’s too many choices; there’s lots of choices in the world. You don’t know what to focus on. You know, there’s different algorithms you can use.…