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
Harvesting Mussels In Ireland | National Geographic
[Music] Hi, I’m Katie and I’m Colleen, and we’re the Chip Sisters. Today, we’re at Killer Yard, and we’re learning how to harvest mussels in Ireland. [Music] Hilary Harper is a Ford located in the west of Ireland in Northern Connemara. Mussel farming sta…
Reasoning with systems of equations | Equivalent systems of equations | Algebra I | Khan Academy
So let’s say I had the equation (2x + y = 8). This is a single equation with two unknowns, and there are many different (xy) pairs that would satisfy this equation. Now let’s add a second equation: (x + y = 5). Once again, if we only looked at this second…
The Fascinating Lives of Bleeding Heart Monkeys (Part 2) | Nat Geo Live
Spending just a few days and weeks with these monkeys, you start to see their individual personalities start to emerge. Some of them are chatty, some of them are kind of quiet, others are just plain old mean. And while it’s interesting to watch this just …
Exploding Weed Seeds (28,546 fps Slow Motion)- Smarter Every Day 257
A portion of this video is sponsored by Google. More on that later. Here on Smarter Every Day, I like to explore things, and I like to figure them out for myself. And there’s one thing that you can do with the internet that’s really cool: you can just go …
The aggregate production function and growth | APⓇ Macroeconomics | Khan Academy
In a previous video, we have introduced the idea of an aggregate production function, which is a fancy way for a mathematical model that an economist might use to tie the factors of production in an economy to the actual aggregate output of an economy. Th…
Human fertilization and early development | High school biology | Khan Academy
[Instructor] What we’re gonna do with this video is talk about fertilization and development in human beings, or at least early development in human beings. And this right over here is an actual image of fertilization about to happen or happening. So th…