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
Mirror equation example problems | Geometric optics | Physics | Khan Academy
Mere equation problems can be intimidating when you first deal with them, and that’s not because the mere equation is all that difficult. It’s kind of easy; it’s just a few fractions added together. The place where it gets tricky is deciding whether these…
The Japanese Have it Figured Out
Have you ever heard of blue zones? These are areas in the world where a large number of centenarians live. That’s people who are over 100 years old. Many people have studied these areas to try and discover the secret to longevity, and the thing they found…
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…
Great White Shark Photo Shoot: Don't Try This At Home | National Geographic
Look at him right here! God, he’s big. Whoa, look at the size of that animal coming right at us! I am in Cape Cod, Massachusetts, which over the last few years has become sort of great white shark central. Man, look at all the seals! That explains everyth…
Everything About Irrigation Pivots (Farmers are Geniuses) - Smarter Every Day 278
If you’ve ever been flying in an airplane and you look out the window and you see these big green circles in the middle of a field, what is that? Today, we’re going to build the thing that makes this happen. This is my buddy Trey; he’s a farmer. Farmers a…
The 10 Trillion Parameter AI Model With 300 IQ
If O1 is this magical, what does it actually mean for Founders and Builders? One argument is it’s bad for Builders because maybe O1 is just so powerful that OpenAI will just capture all the value. You mean they’re going to capture a light cone of all futu…