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
How We're Redefining the kg
What do I have to push, sub-basement? Woman: Sub-basement. [Buzzing safety alarm] I’m at the National Institute of Standards & Technology in Washington D.C. and I’m going to the sub-basement. It’s getting dark down here. We’re going to find out how t…
Modeling with multiple variables: Taco stand | Modeling | Algebra 2 | Khan Academy
We’re told a certain taco stand sells t tacos per day for a net profit of 300. Each taco costs c dollars to make and is sold for p dollars. Write an equation that relates t, c, and p, so pause this video and see if you can do that. All right, now let’s w…
Measuring public opinion
In this video, we’re going to talk about measuring public opinion. The first question to ask yourself is: why would we even want to measure public opinion? Well, if we live in a democracy where the public has a huge influence on our government, you want t…
Quick and Easy Voting for Normal People
Hello Internet! You know I love me some voting videos. These, however, are mostly about how organizations can improve their elections. But normal people need better voting too. Say a group of you are trying to decide what to have for dinner. There are th…
Electromagnetism 101 | National Geographic
[Instructor] Electromagnetism or the electromagnetic force is one of the four fundamental forces of nature. It generates light and energy and holds atoms, matter, and the world as we know it together. Electromagnetism is a branch of physics that studies…
Are You A Nihilist?
We all know how it goes. One day we’re born, one day we die. Everything that happens in between we know and understand, but everything that happened before and will happen after we know nothing about. As a result, it’s really difficult to say what exactly…