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
Expression for compound or exponential growth
You put $3,800 in a savings account. The bank will provide 1.8% interest on the money in the account every year. Another way of saying that is that the money in the savings account will grow by 1.8% per year. Write an expression that describes how much m…
Charitable giving | Financial goals | Financial Literacy | Khan Academy
So let’s talk a little bit about charitable giving, and this one is close to my heart because I run a non-profit. Why do folks donate to charity? Well, you might have your own motivations. For most folks, I think it just feels good. They might feel that …
Why Do We Kiss?
Hey, Vsauce, Michael here. Attachment of two people’s lips kissing. The average person will spend about 20,160 minutes of his or her life kissing. And the world record for the longest, continuous kiss is 58 hours, 35 minutes, and 58 seconds. But why do we…
How Trees Secretly Talk to Each Other in the Forest | Decoder
Ouch! What do you think you’re doing? The idea of talking trees has been capturing the human imagination for generations. Did you say something? My bark is worse than my bite. Okay, so maybe they don’t talk to us, but it turns out, trees can “talk” to ea…
Who Owns Antarctica?
Antarctica, home to the south pole(s), penguins, and about 5,000 people during the summers, but less than 1,000 during the ever dark winter. No one lives on the continent permanently, so, who owns Antarctica? Most stuff outside national borders, the sea f…
How to Bring Mastery Learning to Your Class... And Get Results Like Tim's!
Hi everyone! This is Jeremy Schiefling with Khan Academy. I want to thank you for joining us this afternoon or this evening depending on where you’re calling in from, and you are in for a very special treat. So as you probably know, we’ve been doing webi…