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
Warren Buffett: How Long Can This Stock Bubble Last? (2021)
It’s no secret that stock prices have continued to hit all-time highs. All three major American stock market indices, the S&P 500, the Dow Jones Industrial Average, and the Nasdaq, all are at record highs. That has led to some very prominent and highl…
Formation of biomolecules | High school biology | Khan Academy
[Sal] So all organisms need food to survive. Now, for some of you, this might be pretty obvious. You realize what might happen to your body if you don’t get food. You might realize that you need that food for both energy and you need that to actually buil…
Warren Buffett: The Coming 45.1% Stock Market Reset
Warren Buffett’s favorite measure of the health of the stock market is sending some serious warning messages. In fact, the so-called Warren Buffett indicator is projecting that the U.S. stock market has to fall by a whopping 45.1 percent in order for the …
Steve Jobs in Sweden, 1985 [HQ]
[Music] Glad to meet you. [Applause] The doors have been locked and all of you that don’t sign up to buy computers will stay here, and we will bring back the singers. I am extraordinarily pleased to be able to be here with you. This is one of my perso…
Variance of sum and difference of random variables | Random variables | AP Statistics | Khan Academy
So we’ve defined two random variables here. The first random variable, X, is the weight of the cereal in a random box of our favorite cereal, Matthews. We know a few other things about it. We know what the expected value of X is; it is equal to 16 ounces.…
How Pharaohs Projected Divine Power | Lost Treasures of Egypt
These iconic monuments are just shouting, screaming at us: power, dominance, control. I feel about this; I feel so insignificant. Together, these pyramids and the Sphinx and the temples create a landscape of [Music] power. The huge sculpture protects the …