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
Travel INSIDE a Black Hole
Hey, Vsauce. Michael here. And today we are going to go inside a black hole. It’s not going to be comfortable, but it will be pretty fun. Now, first thing’s first: mathematically speaking, anything could become a black hole if you were to compress it int…
15 Signs You’re NOT COOL
We are not talking about people who use the wrong emojis here, but there’s a case to be made about some of you not being as cool as you think you are. So, let’s put it to the test and see how many of these you tick off. Here are 15 signs you’re not cool. …
Is Your Red The Same as My Red?
Hey, Vsauce. Michael here. This appears blue. This appears yellow. And this appears green. Those of us with normal color vision can probably agree. But that doesn’t change the fact that color is an illusion. Color, as we know it, does not exist in the out…
Relating fractions to 1
We are told to select the two fractions that are greater than one, so pause this video and see if you can figure out which two of these fractions are greater than one. All right, now let’s work on this together. The main realization here, the main thing …
Signs of a Toxic Friend | Buddhist Philosophy
At some point in our lives, we begin to question our friendships. Some friendships have stood the test of time and can still be considered sources of mutual enjoyment and growth. But other friends do not seem to add any value to our lives. Or worse: they’…
Schopenhauer: The Philosopher Who Knew Life’s Pain
When Arthur Schopenhauer was walking his poodle, he looked at the world with sadness. He saw humans and animals struggling to survive in a world they never chose to be in. And from the day they were born, the suffering only worsened as they contracted dis…