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
She Summited Each Continent’s Highest Mountain To Empower Women | Nat Geo Live
I work for the women in my country who are facing crazy mountains without even having to step on a mountain. And I thought of a campaign to go climb the highest mountain of every continent in the world, knowing that the struggle in the mountain was so par…
When the functions of money break down: Hyperinflation | AP Macroeconomics | Khan Academy
So in the last video, I was talking about various functions of money. You know, the first was that it’s a medium of exchange. If you want to trade for things, typically you give someone money, and they give you the thing, rather than trying to barter, tra…
The Excavation of Tutankhamun’s Mummy | King Tut in Color
NARRATOR: At last, in October 19, 2005, after three years of excavating Tutankhamun’s tomb, Howard Carter and his team begin to open the king’s coffin. Lifting its lid exposes another shroud. When Carter carefully peels that back, he discovers a second gi…
Hunting for Deer | Life Below Zero
♪ ♪ ♪ ♪ Yeah, you can see that, uh, something just came down through here. All this lichen’s all rubbed off. Could be, probably more than likely an old slide, maybe a bear come down through here. Never know. Not seeing any tracks or signs. So I don’t …
How Rescue Dogs Are Helping Veterans With PTSD | National Geographic
My Dog Freedom is… I can’t say he’s a pet because that’s just… it’s not enough. Freedom not just changed my life; he did save my life. I was in a hard downward spiral, literally sitting in this chair, starving myself to death. I wouldn’t answer the phone,…
Mr. Freeman, part 03
Do you like prostitutes? Me, I like them very much! After all, it is the most ancient profession that has so much in common with politicians, actors, and journalists. In all cases, it’s possible to be the Creator or a buffoon, to deliver vulgar lust or tr…