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
Credit 101: What is APR and why does it matter? | Loans and debt | Financial Literacy | Khan Academy
Let’s talk a little bit about credit, in particular how much you pay for credit. So just as a reminder, credit is essentially the ability, or when you actually borrow from someone else. It could take the form of a mortgage, where you say you’re borrowing…
How High Can We Build?
Hey, Vsauce. Michael here. And when the pyramids of Giza were built, the tallest was 147 meters tall, making them the tallest things humans had ever built. And they remained that way for nearly 4,000 years. It wasn’t even until the 1300’s that we finally …
Socially efficient and inefficient outcomes
Let’s study the market for soda a little bit. So, we’re going to draw our traditional axes. So that is price, and that is quantity. We have seen our classic supply and demand curves. So, this could be our upward sloping supply curve. At a low price, not a…
Phases of the moon | Middle school Earth and space science | Khan Academy
Imagine that one day all of the clocks and computers on Earth broke and all the calendars disappeared. How would you keep track of how much time had passed? Well, you could look to the moon. Humans have used the moon to keep track of time for thousands of…
Helping to Protect the Okavango Basin | National Geographic
This is a perfect wilderness. It’s vast. Unending. When this wetland floods, it grows to around 22 thousand square kilometers, becoming visible from space. Surrounded by the Kalahari Desert—one of the driest places on earth—the Okavango Delta is a water w…
Estimate multiplying multi digit numbers
What I would like to do in this video is get some practice estimating the product of multi-digit numbers, and there’s just no better way of getting practice than just trying it ourselves. So, right over here, it says estimate 29 times 3198. Why don’t you…