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
Education as a force of convergence | Macroeconomics | Khan Academy
We talked about the dissemination of information being a force of convergence on the global scale, but what about on the individual scale? When we’re talking about knowledge dissemination on an individual scale, we’re really talking about education on som…
Khan Academy Talent Search 2016
Hi, this is Sal Khan, founder of the KH Academy, and I just wanted to announce our second annual Talent Search. As you may know, KH Academy, we’re a non-profit with the mission of a free, world-class education for anyone, anywhere. Part of that is creatin…
Congress Wants To Reset Investing | Savings At Risk
What’s up guys, it’s Graham here. So Congress is about to pass several major changes to your retirement account that everybody needs to be made aware of because once this goes into effect, you either stand to make or lose quite a lot of money. Not to ment…
TRUMP JUST STORMED WALL STREET
What’s up, grab it’s guys here. So, normally I don’t make videos like this, and I tend to stay away from anything involving politics. But today we gotta talk about one of the most requested topics of investing that stands to make or lose people a lot of m…
Interpreting unequal ratios
We’re told that Akeem’s recipe for blackened catfish uses 19 grams of their favorite blend of ground pepper for every four catfish fillets. Tisha uses 25 grams of the same blend of ground pepper to cook six catfish fillets. Assuming the fillets are the sa…
Charlie Munger: 100 Years of Wisdom Summed up in 20 Minutes
And I’ve catalogued the inanities on structures in my head, and it’s been a wonderful thing to do. If you stop to think about it, how many unhappy collectors do you know? Whether they collect silver, or mistresses, or you know… I thought I would speak ton…