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
Whoopi Wants in on Star Trek | StarTalk
Not until Lieutenant Uhura do we even appear in the future. Right, right? You know, now Jean Roddenberry didn’t realize how big a deal this was, ‘cause he didn’t realize that we didn’t appear anywhere. The social impact of it, again, he’s just doing it be…
Input approach to determining comparative advantage | AP Macroeconomics | Khan Academy
In other videos, we have already looked at production possibility curves and output tables in order to calculate opportunity costs of producing a certain product in a certain country. Then we use that to think about comparative advantage. We’re going to d…
Peter Lynch: How to Invest in an Overvalued Market
One thing you’re trying to do is say all these public companies out there, here’s the company I really like. The fundamentals are terrific, their earnings are doing well, the competitors are doing poorly. I think this company’s doing terrific, and all of …
Money: Humanity's Biggest Illusion
If I asked you the question, “What is man’s greatest invention?” what would your answer be? There’s a lot of options. Would it be fire because it gives us warmth, protection, and the ability to cook our meals? Or perhaps you would pick the wheel because i…
Insurance terminology | Insurance | Financial Literacy | Khan Academy
Now let’s talk about some of the words you’re likely to hear if you’re dealing with insurance. So the first one is a premium, or an insurance premium, and that’s really just what you’re paying in order to get the insurance. So if you pay, let’s say, 200 …
Reform in the Gilded Age | AP US History | Khan Academy
In the year 2000, a wealthy Bostonian named Julian West woke up from a very long nap. He had fallen asleep in the year 1887. The United States in the year 2000 was very different from the Gilded Age he knew. It was a utopian society where there was no pov…