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
The Worst Place to Change a Tire | Continent 7: Antarctica
The Ross Ice Shelf team is at a dead stop in a growing storm, 100 miles from help. You out, you in the middle of nowhere; no one’s really been here before. Your life is in danger if you go outside and hang around in there too long. Rob has to change a fla…
Howard Marks & Joel Greenblatt on Value Investing
So I don’t think the reason people don’t beat the market is because the market is efficient or even close to efficient or not emotional. It’s very emotional. Or that it can’t be done. There’s all kinds of institutional and agency reasons and tons of other…
Misconceptions About Temperature
When you touch an object and it feels warm or cold, what is that really telling you about the object? Here, I have a metal hard drive and a book, and I’m going to ask people to compare their temperatures. Which one do you think will feel warmer - the boo…
THE END OF THE 4% RULE | Goodbye Savings
What’s up Grandma? It’s guys here! So here’s the thing: if you want to invest your money, build your wealth, and earn enough passive income, then never have to work another day in your entire life ever again, there’s an easy calculation for that called th…
Talking With Attenborough
[Music] Hey, Vau! Michael here. This is the song of the Kawaii oo bird. In 1987, this species of bird became extinct; there are no more. But before the last living one died, its song was recorded. Ed, this is that song. It is the song of an endling, the …
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. …