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
GPT-4o (Omni) Human interaction demo w/ Sal Khan
Hello there! Can you see us? Yes, I can see you. How can I assist you today? So, um, I’m here with my son, and I’d love to see if you could drive a conversation that could help us get to know each other better. So, ask us questions and also ask us follo…
Inverse matrices and matrix equations | Matrices | Precalculus | Khan Academy
In a previous video, we talked about how you can represent a system of equations as essentially a matrix equation. So, for example, here I have two equations with two unknowns, x and y. Well, let’s just assume that we know what a, b, p, c, d, and q, r are…
Slope from equation | Mathematics I | High School Math | Khan Academy
We’ve got the equation ( y + 2 = -2 \cdot x - 3 ), and what I want to do is figure out what is the slope of the line that this equation describes. There’s a couple of ways that you can approach it. What my brain wants to do is, well, I know a few forms w…
Dalton Caldwell - Startup Investor School Day 2
Hey, good morning! Thank you. We have a lot to do today, so I’d like to get my part out of the way as quickly as possible. Good morning again, and welcome to our second day of Startup Investor School. My role is a little bit more, but not much more than …
The Japanese Government Wants You to Date | Explorer
[music playing] FRANCESCA FIORENTINI (VOICEOVER): Here in the Japanese countryside, some of Japan’s most eligible bachelors are waiting to meet their mates. The mayor is here. Parents are here. Eligible bachelors and bachelorettes are here. FRANCESCA FI…
The Sinking of the SS Athenia | WW2 Hell Under the Sea
NARRATOR: As the opening day of the Second World War fades, Lemp strains to identify the ship in front of him. CHRISTIAN JENTZSCH: It’s behaving, in his opinion, like an auxiliary cruiser because it’s zig-zagging and it’s blacked out. And he even imagine…