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
Ice Spikes Explained
Have you ever made ice cubes and then found that when you take them out of the freezer there are spikes on them? This phenomenon has caused a lot of curiosity and some concern. The truth is, there is a simple physical process responsible for ice cube spik…
A Meeting with the President | Genius: MLK/X | National Geographic
Look, either we’ve been summoned here so he can pressure us to accept watered down amendments to Kennedy’s civil rights bill, if the bill still exists. Whatever it is, we need to hear him out, because like it or not, whoever occupies that office holds the…
Using the logarithm change of base rule | Mathematics III | High School Math | Khan Academy
So we have two different logarithmic expressions here, one in yellow and one in this pinkish color. What I want you to do, like always, is pause the video and see if you can rewrite each of these logarithmic expressions in a simpler way. I’ll give you a …
The Hittite Empire and the Battle of Kadesh | Early Civilizations | World History | Khan Academy
Now going to talk about a people that began to settle and eventually conquer much of Anatolia, modern-day Turkey, at the beginning of the second millennium BCE. These people are known as the Hittites. The word “Hittite” is referred to in the Hebrew Bible …
Gainers & 3D Thinking - Cliff Jumps - Smarter Every Day 29
(Riddy) Body motions. Welcome to Smarter Every Day and like he said, today we’re gonna learn about rigid body motion. For any object, there are three axes of translation, and there’s also three axes of rotation. These axes are called roll, pitch, and yaw.…
Kevin O'Leary REVEALS His MULTI-MILLION Dollar Watch COLLECTION!
Hi there! As always, this week’s episode of Ask Mr. Wonderful comes from questions. It’s a dialogue; it’s a two-way thing. What I’m trying to do is gather a lot of questions into areas where it’s the same question over and over again, so I’m answering as …