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
Seal Pups: Ferociously Cute and Worth Protecting | Expedition Raw
When working with fur seal pups, you really need to watch out for your rank. Personal pups are tiny, but they are ferocious in their own right. We’re weighing fur seal pups to make sure that they’re getting enough food to eat, and if they’re not, we can u…
360° Wingwalker - Part 1 | National Geographic
[Music] [Music] For me, when walking is about the ultimate freedom. Once you’ve tasted that type of freedom, I mean, you just can’t ever go back. It is absolutely liberating. But if you mess up even a little bit, it’s all over. You’ll have to be responsib…
Michael Burry: How You Should Invest In 2022
Right, we bought basically short 8.4 billion of credit default swaps, um, related to mortgages or financial companies, and I was extremely confident in the outcome. Were your investors as confident? I know for sure that some of them thought I lost my mind…
Creating a Food Forest | Farm Dreams
[Music] Oh, there’s baby chicks! Yep, two weeks old. I’ve gotta hold them. Hi, little friend! I sent Bob some photos and a description of Jill and Craig’s seven-acre plot, hoping he can offer advice on the best way to actualize their vision. Okay, this …
Things That Don't Scale, The Software Edition – Dalton Caldwell and Michael Seibel
We’ll get a founder that’s like, “Oh, how do I like test my product before I launch to make sure it’s gonna work?” And I always come back and tell the founders the same thing: like if you have a house and it’s got full of pipes, and you know some of the p…
My minimalist productivity setup
[Music] Welcome to where the magic happens. You’ve seen this place before, mostly in the background of these a-roll shots and in b-roll shots where I’m either wasting time or being productive—the only two types of b-roll shots on this entire channel. But …