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
Daily Eccentric Habits of Kevin O’Leary
[Music] Everybody asking all the time, how do you keep everything moving forward when you’re traveling all over the place? This is a good example. I’m out in California here at the Sony lot, shooting season 11 of Shark Tank. Now, this is pretty industrio…
The mole and Avogadro's number | Moles and molar mass | High school chemistry | Khan Academy
In a previous video, we introduced ourselves to the idea of average atomic mass, which we began to realize could be a very useful way of thinking about a mass at an atomic level or at a molecular level. But what we’re going to do in this video is connect …
Everything We Dont Know About the Mind
Consciousness, it’s our awareness, our understanding, our ignorance, our daily Consciousness. Consciousness leaves out more than it takes in, and due to this, it leaves out important things; things that would help relieve us if we knew them. If we had a …
Read What You Love Until You Love to Read
Before we go and talk about accountability and leverage and judgment, you’ve got a few tweets further down the line that I would put in the category of continuous learning. They’re essentially: there is no skill called business. Avoid business magazines …
3 Sources of Water on the Moon
Is there water on the Moon? The obvious answer seems to be no. Because during a day on the Moon, which lasts 2 Earth weeks, the temperature on the lunar surface gets up to 123 degrees Celsius, which would be enough to boil away any water if the Moon had a…
Sardine Feeding Frenzy | 50 Shades of Sharks
NARRATOR: What’s more thrilling than a shark? A mob of them. Sharks might have invented crowdsourcing. Every year between May and July, billions of migrating sardines come to spawn off the coast of South Africa, catering one of the largest feeding frenzie…