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
Everybody wants to love - Ingrid Michaelson cover
One two three [Music] four. We have fallen down again tonight. In this world, it’s hard to get it right, trying to make your heart fit like a glove. [Music] What you need is love, love, love. Everybody, everybody wants to love. Everybody, everybody wants…
Elon Musk's Twitter Takeover Explained...
Elon Musk, the world’s richest person, is currently attempting the most controversial takeover the world has ever seen. Using the power of his extremely high net worth, he’s trying to buy Twitter outright and take the company private to make changes to th…
World's Highest Jumping Robot
This tiny robot weighs less than a tennis ball and can jump higher than anything in the world. In the competitive world of jumping robots, the previous record was 3.7 meters, enough to leap a single-story building. This jumper can reach 31 meters, higher …
Why We’re All Burning Out | Byung-Chul Han’s Warning to the World
Aren’t we living in the best age ever!? I mean, look at the world around us! Modern society grants us endless possibilities. Contrary to our grandparents (and their parents), who were told to just pray to God, have kids, work in the factory, and shut up, …
Pregnancy 101 | National Geographic
(elegant piano music) [Narrator] The product of millions of years of evolution, the human body is capable of many remarkable things, but none of which may be quite so incredible as the development of life in utero. (calm music) Over three million babie…
Implanting Memories | Breakthrough
My work focuses on finding individual memories in the brain and actually turning them on or off. We had a series of projects where we started off by asking really simply: can we go in and can we just find a memory in the brain? Can we isolate a memory in …