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
More Than a Grand Canyon | America's National Parks | National Geographic
[MUSIC PLAYING] [BIRDS CHIRPING] The Kaibab Plateau is home to one of the last ponderosa pine forests in the southwest. It’s a unique habitat, protected by Grand Canyon National Park, and a spectacle to behold. [MUSIC PLAYING] Less than 5% of the 6 mi…
Do We Have Free Will? | Robert Sapolsky & Andrew Huberman
Speaker A: - Along the lines of choice, I’d like to shift gears slightly and talk about free will, about our ability to make choices at all. Speaker B: - Well, my personal way out in left field inflammatory stance is I don’t think we have a shred of free…
How Understanding the Typical Life Arc can Give you Perspective
Most people’s lives are, there’s a life arc, and most people’s lives transpire in like ways that you could see over and over again. You know, so I break it down. It seems to me like there are three big phases in life. The first phase is you’re dependent …
What is a Virus? | Breakthrough
Virus is actually just genetic material encased in an envelope, and it actually needs a host like me or you in order for it to infect and continue to produce more copies of itself. So what happens is a virus infects me, let’s say, and my immune system sta…
Sewage treatment | Aquatic and Terrestrial Pollution | AP Environmental Science | Khan Academy
This is my cat, Rubiks. One of the many amazing things about Rubiks is that he naturally works to keep himself clean. His barbed tongue is really good at getting rid of the dust and dirt that he gets in his fur every day, but sometimes he needs a little h…
Contentious | Vocabulary | Khan Academy
I’ve got a bone to pick with you wordsmiths because this video is about the word contentious. Contentious is an adjective and it means involving arguing, quarrelsome. We had a contentious debate over whether bears were scarier than snakes. Kind of looks l…