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
Proof: parallel lines have the same slope | High School Math | Khan Academy
What I want to do in this video is prove that parallel lines have the same slope. So let’s draw some parallel lines here. So that’s one line, and then let me draw another line that is parallel to that. I’m claiming that these are parallel lines. Now I’m …
Warren Buffett Just Made a Huge $6.7B Investment.
Over the past few months, Warren Buffett has been hiding something: a secret stock, a secret position that was deliberately not disclosed to the public in his periodic 13F filings. And the SEC let him do it. They gave Buffett permission to buy up a stock …
Danae Ringelmann at Startup School SV 2014
First of all, this is totally awesome. Um, I want everybody to actually take a minute, a moment of silence, and appreciate the fact that you’re here. Um, and appreciate the fact that your whole life has been leading to this point. You might all be thinkin…
Introduction to verb tense | The parts of speech | Grammar | Khan Academy
Hello grammarians! Today, I want to introduce the idea of the verb tense. The way I want to do that is to express the following: if you can master grammatical tenses, you will become a time wizard—a literal, actual time wizard. Because tense is nothing mo…
Constructing exponential models | Mathematics II | High School Math | Khan Academy
Derek sent a chain letter to his friends, asking them to forward the letter to more friends. The group of people who receive the email gains 910 of its size every 3 weeks and can be modeled by a function P, which depends on the amount of time T in weeks. …
Apoptosis | Cell division | Biology | Khan Academy
Hello Emily, hello David. So we’re here today to talk about apoptosis. Uh, I was going to ask you some questions about it; you were going to explain what it even is to me. Absolutely. Okay, talk apoptosis. So, this word apoptosis—I did a little bit of …