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
Energy Conservation| Energy Resources and Consumption| AP Environmental Science| Khan Academy
In this video, we’re going to talk about energy conservation, or trying to save or lower the amount of energy that we use. Now, a lot of y’all might already have a sense that that is a good thing, while others of you might say, “Hey, why can’t I just use …
Why Anecdotes Trump Data
Some critics of the TV show Mythbusters claim that the show misrepresents the scientific process. For example, experiments are sometimes conducted only once and without adequate controls, but then these results are generalized to make definitive claims ra…
Worked examples: Definite integral properties 1 | AP Calculus AB | Khan Academy
We want to evaluate the definite integral from 3 to 3 of f of x dx. We’re given the graph of f of x and of y equals f of x, and the area between f of x and the x-axis over different intervals. Well, when you look at this, you actually don’t even have to …
Words Are the Most Powerful Drug | Origins: The Journey of Humankind
Humans stand alone in the animal kingdom. Our power over nature is unparalleled. What separates us? What is it that makes us human? The answer lies in our mastery of communication: the power to express complex thoughts and ideas; to organize and think col…
Multiplying 3-digit by 2-digit numbers: Error analysis | Grade 5 (TX TEKS) | Khan Academy
So we have a situation here where someone is attempting to multiply 586 * 43, and what we want to do together is figure out if they did this correctly or whether they made a mistake. And if they made a mistake, what step did they make a mistake on? Actual…
The Gig Economy is Terrible: Here's Why
Meet Abraham. He’s trying to pay off the lease on his new Lincoln. He got it to stand out in the fleet of other Uber vehicles. He drives for hours every day to try and make a living from what was once a lucrative job. Now, Abraham is barely making it from…