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
How Trees Bend the Laws of Physics
Sometimes the simplest questions have the most amazing answers. Like how can trees be so tall? It’s a question that doesn’t even seem like it needs an answer. Trees just are tall. Some of them are over 100 meters. Why should there be a height limit? I’ll…
Inside the Paris Climate Conference | Years of Living Dangerously
This is the Olympics of climate change. If you’re not here, you’re not in the game, and the game is to do something urgently. We have the political will to change, and it really is the seminal meeting of leaders to determine what we do to combat this prob…
Alleged Miracle | Explorer
[Music] Magigoria does change people’s lives. Janna Sullivan is still living the miracle she experienced there, and her husband has been there as witness. Glory be to the Father and to the Son. I’ve probably been present at close to 3500 of J’s apparitio…
15 Deals That Made Billionaires
They say that if you want to go fast, you should go alone. But if you want to go far, you should pick some great partners to share the journey with. The people on this list made insane fortunes because they chose the latter, and in this video you’ll learn…
How To Get Rich According To Jeff Bezos
There are a million ways to make $1,000,000. And this is how Jeff Bezos did it. He needs no introduction. Right. So let’s just cut straight to the chase. Customers have the money, not the competition. Well, many people think about the competition. Bezos …
This Is What Happens to Your Brain on Opioids | Short Film Showcase
This is Susan. Susan loves to bike. While out for a ride, she falls and breaks her arm. Special cells called neurons send a signal through the spinal cord to the brain, which interprets the signal as pain. Susan understands the pain means she needs to go…