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
Theorem for limits of composite functions: when conditions aren't met | AP Calculus | Khan Academy
In a previous video, we used this theorem to evaluate certain types of composite functions. In this video, we’ll do a few more examples that get a little bit more involved. So let’s say we wanted to figure out the limit as x approaches 0 of f of g of x. …
Solar Roads: Can Streets Become Giant Solar Panels? | National Geographic
[Music] [Music] There is a project in the United States called solar roadways, which consist of concrete slabs including the solar cells, plus tempered glass on top of it. There’s a quite similar project in the Netherlands called solar Road. A section on …
Tracking Tigers Is Just As Dangerous As It Sounds | Expedition Raw
We’re setting camera traps to study tigers. Two people got eaten by tigers right before we started. When there’s a tiger around, you can’t sleep; you can barely eat. You can’t do anything because all you are scared for your life. I’ve been in Indonesia n…
KNOWLEDGE! --- LEANBACK #7
Hello, Vsauce. Michael here, and today I have a brand new episode of Vsauce Leanback, a playlist that I host made out of awesome videos from all over YouTube. The theme for this one is stuff I didn’t know last week, but now I do. It’s fun and you can begi…
Warren Buffett is Buying These 10 Stocks!
[Music] Please [Music] Okay, but in all seriousness, I love getting to see what stocks Warren Buffett is buying and selling. You’re going to want to stick around until the end of this list because there’s definitely some shockers here. Let’s get right int…
Buy REAL Dino Teeth! ... and more! LÜT #20
An R2-D2 pepper mill and cologne that makes you smell like Play-doh. It’s episode 20 of LÜT. This wallet looks like a lot of hundreds, and these bars of soap from ThinkGeek contain caffeine, really. Each shower you take delivers the same as a cuppa coffe…