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
Functions | Intro to CS - Python | Khan Academy
You’re writing a program, and it’s starting to get pretty long. Plus, you’re duplicating a lot of code because you need to perform the same task at several different points in the program. How can we better keep this code organized and reduce the repetiti…
More advanced subtraction strategies with hundredths
So let’s say we wanted to compute 8 and 38 hundredths minus 4 and 54 hundredths. See if you can pause this video and figure it out on your own. There are multiple strategies for doing this. I’ll tell you the way that my head likes to do this. I would vie…
Bringing Life-Changing Treatments to the Blind in India | National Geographic
The world is invisible to the blind people, but at the same time, the blind people withdraw themselves from the surrounding, and they make them invisible. Unless the people who are cited actively try to find them out, they will remain in the dark. [Music…
The Index Fund Problem Looming in 2024
I told you not to sell. I worry about it. A good.com. Do you happen to own index funds in your portfolio? Maybe SPY from State Street or VO from Vanguard or IVV from Black Rock? All these ETFs track the S&P 500, which is an index composed of the large…
Human Extinction
Hey, Vsauce. Michael here. Do you want to be infected with Ebola without having to leave your own home or deal with other people? Well, you might be in luck. You can already download an Ebola virus genome. Right here on the Internet, right now. And if you…
Treating systems (the easy way) | Forces and Newton's laws of motion | Physics | Khan Academy
So in the previous video, we solved this problem the hard way. Maybe you watched it, maybe you didn’t. Maybe you just skipped right to here and you’re like, “I don’t even want to know the hard way. Just show me the easy way, please.” Well, that’s what we’…