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 Explains How To Calculate Intrinsic Value Of A Stock
Yeah, the actually Graham didn’t get too specific about intrinsic value in terms of precise calculations, but intrinsic value has come to be equated with, and I think quite properly with, what you might call private business value. Now, I’m not sure who w…
How Much Does a Shadow Weigh?
Hey, Vsauce. Michael here. And I’m sure that we all love to have fun with hand shadows, but how much does a shadow weigh? It might sound like a silly question, because it is. I mean, a shadow cannot be put on a scale and weighed. But the material that it…
Safari Live - Day 142 | National Geographic
This program features live coverage of an African safari and may include animal kills and carcasses. Viewer discretion is advised. Good afternoon and welcome to the Sunset Safari 2.0! My name is Taylor McCurdy, and on camera with me today is Senzo. Of co…
Misconceptions About Temperature
When you touch an object and it feels warm or cold, what is that really telling you about the object? Here, I have a metal hard drive and a book, and I’m going to ask people to compare their temperatures. Which one do you think will feel warmer - the boo…
How Fear and Anxiety Drove Human Evolution | Nat Geo Explores
The heart races. Deep breaths are hard to find. Blood rushes through the body; that’s fear. Anxiety, scientifically, we tend to talk about fear as being a response to immediate threats, which is right there in front. First, anxiety is where there’s the po…
The Future of the Channel, and You
Good morning, internet. I came out here to write and to research, and to think about the channel and its evolution. The Staten Island video, for example, started life as part of the background reading for the Statue of Liberty video. Originally planned to…