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
Chernobyl - What It's Like Today
That is Chernobyl nuclear reactor number four. It melted down on April 26, 1986. So, what happened was so much heat was generated inside that reactor that it basically blew the top off, spreading radioactive isotopes throughout this whole surrounding area…
Natural selection in peppered moths | Middle school biology | Khan Academy
You might be familiar with the idea of evolution, that species change over time, and you can see that if you look at old bones, old fossils, how they change through the fossil record. But the obvious question is, how do these species actually do that? Wha…
What Actually Causes Dandruff?
Hey! This episode was sponsored by Head & Shoulders. A hundred and twenty-five million years ago, in what is now China, dinosaurs walked the earth, and a few species of small feathered dinosaurs climbed trees. This is Sinornithosaurus. Although they c…
The Stilwell Brain
“I think, therefore, I am.” But am I? I think. Ha. A single microscopic brain cell cannot think, is not conscious, but if you bring in a few more brain cells, and a few more, and connect them all, at a certain point, the group itself will be able to think…
Pushing The Limits Of Extreme Breath-Holding
Inside the tank is Brandon Birchak, and he is going to attempt to hold his breath for this entire video. (dramatic music) Brandon is one of the world’s foremost experts in breath work, so please don’t try this at home. I’ll put his info in the description…
Circuit terminology | Circuit analysis | Electrical engineering | Khan Academy
In this video, we’re going to talk about some terminology that we use to talk about how circuits are put together. In previous videos, we’ve talked about the components or elements that are used to make up circuits. So, for example, a resistor, capacitor,…