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
🇺🇸 DOES YOUR FLAG FAIL? Grey Grades State Flags!
[school bell rings] Hello, class. Your homework assignment as the U.S. states that you are was to make your state flag. A flag to stir pride in your citizens. A flag to stand proud on the American stage. A tough task, though not too tough with the guidel…
2015 AP Calculus 2c | AP Calculus AB solved exams | AP Calculus AB | Khan Academy
Let H be the vertical distance between the graphs of f and g in region s. Find the rate at which H changes with respect to x when x is equal to 1.8. So, we have region s right over here. You can’t see it that well since I drew over it. What you see in re…
Preview Get Ready for Grade Level
Here’s an example of a Get Ready for Grade Level course. In this case, it’s Get Ready for Sixth Grade, and there are a couple of interesting things here. First of all, you can see that the course is broken down into units, like all of our courses are brok…
Why Four Cowboys Rode Wild Horses 3,000 Miles Across America (Part 2) | Nat Geo Live
April first, we began our journey that is at the border of Arizona and Mexico, and I promise you we did not plant that flag there. We just rolled up in real life; it’s kind of photogenic. We’ll take a picture next flag. So we started our journey, and we …
Linear vs. exponential growth: from data | High School Math | Khan Academy
The number of branches of an oak tree and a birch tree since 1950 are represented by the following tables. So for the oak tree, we see when time equals 0 it has 34 branches. After three years, it has 46 branches, so on and so forth. Then for the birch t…
Identifying the constant of proportionality from equation | 7th grade | Khan Academy
When you hear “constant of proportionality,” it can seem a little bit intimidating at first. It seems very technical, but as we’ll see, it’s a fairly intuitive concept, and we’ll do several examples. Hopefully, you’ll get a lot more comfortable with it. …