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
How to Win an Interstellar War
Could aliens destroy us from light years away? Mh, another day at the Kurzgesagt Labs, where we answer the most important questions with science. Today: how might civilizations wage war across light years? What kind of devastating weapons could they use, …
Hummingbird Aerodynamics- High Speed Video - Smarter Every Day 27
Hey, it’s me, Destin. So to fly slow is one of the more difficult things to do because you don’t have as much airflow over your control surfaces. To fly at zero air velocity is the hardest thing to do of all. Over the past weekend, I’ve been making observ…
French and Dutch colonization | Period 2: 1607-1754 | AP US History | Khan Academy
Although the Spanish were the first European colonists in the New World, they didn’t remain alone in the Americas for very long. Just three years after Hernan Cortez captured Tenochtitlan, the French government sent its first explorer to poke around North…
Parametric surfaces | Multivariable calculus | Khan Academy
So I have here a very complicated function. It’s got a two-dimensional input—two different coordinates to its input—and then a three-dimensional output. Uh, specifically, it’s a three-dimensional vector, and each one of these is some expression. It’s a bu…
Aqueous solutions | Solutions, acids, and bases | High school chemistry | Khan Academy
What we have here are drawings of five different glass beakers, each holding different liquids or combinations of liquids and other things. Now, the first one here, I would just call that liquid water. That’s in this beaker. We’re going to assume everyth…
Reading multiple accounts of the same topic | Reading | Khan Academy
Hello readers. There’s a famous Japanese movie from 1950 called Rashomon, which is about different perspectives on a horrible crime scene. This is a film for adults, definitely consult your parent or guardian. In the film, you witness four distinct accoun…