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
Support Khan Academy and double your impact
Hi, I’m Sal Khan, founder of the Khan Academy. As you might know, we are a not-for-profit organization with the mission of providing a free, world-class education for anyone, anywhere. The way that we’re able to do that is through the support of folks li…
Ice Age Cave Art: Unlocking the Mysteries Behind These Markings | Nat Geo Live
Genevieve Von Petzinger: This incredible art that mostly dates between 10 and 40,000 years ago. What we often think of, of course, is the animals. But there’s this other enormous group called the geometric signs that outnumber the animals and the humans a…
Worked example: Calculating the equilibrium total pressure after a change in volume | Khan Academy
Phosphorus pentachloride will decompose into phosphorus trichloride and chlorine gas. Kp for this reaction is equal to 0.500 at 500 Kelvin. Let’s say that this reaction is at equilibrium in a reaction vessel that has a volume of 2.0 liters. The equilibri…
This abandoned shed may yet help end the world
This is the Tekoi Test Range. Or, at least it once was. The site is long abandoned now, but it once served a vital purpose. A military purpose. And the work done at Tekoi is still out in the world today. Constructed during the Cold War, at the entrance to…
Make Others Respect You | The Philosophy of Niccolo Machiavelli
According to Machiavelli, if you wanna lead effectively and live in glory, you need to follow three principles: Number one: the people must respect you. This means they fear you but don’t hate you. Number two: fear means fear of punishment. You must be …
WE ATE GOAT BRAINS - Smarter Every Day 20
(African music) (Destin) Okay, Smarter Every Day. Pringles can will make the absolute perfect spaghetti holder when you’re done with the Pringles. There you go. Reuse. Recycle, reduce, reuse, in Africa. Right? Hey, Bob Marley-pants, are you making spa…