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
Minimum efficient scale and market concentration | APⓇ Microeconomics | Khan Academy
In this video, we’re going to think about the concept of minimum efficient scale and then how that impacts market concentration. We’re going to make sure we understand what both of these ideas are. So first of all, minimum efficient scale, you can view i…
Continuity and change in the postwar era | Period 8: 1945-1980 | AP US History | Khan Academy
The era from 1945 to 1980 was action-packed, to say the least. During this period, the United States experienced the baby boom, the civil rights movement, the tumultuous 1960s, and the quagmire of Vietnam. This era was also riddled with contradictions; a …
Controlled Bush Fire Burn | Rebuilding Paradise
ZEKE LUNDNER: One of the things that spread the Camp Fire through Paradise was all the spot fires. All those little baby trees are what carries the fire up into the crowns, and up in the crowns, when wind’s blowing, that’s how you get the one-mile to two-…
The Dark Night of the Soul (Losing Who We Thought We Were)
The endurance of darkness is preparation for great light. John of the Cross. Most of our lives are ongoing pursuits of sensory pleasures. And every time we think that we’ve found lasting fulfillment, it doesn’t take long before we need more gratification…
Intermolecular forces and vapor pressure | Intermolecular forces | AP Chemistry | Khan Academy
So we have four different molecules here, and what I want you to think about is if you had a pure sample of each, which of those pure samples would have the highest boiling point, second highest, third highest, and fourth highest? Pause this video and try…
INSANE BEATBOX and Other MOUTH NOISES -- BOAT
Here’s a guy whose mouth can sound like an engine. And this woman can be a human car alarm. But are those the best mouth noises of all-time? And better yet, what happened to my beard? Well, to figure out the answer to this one, you’ll have to wait for ‘Th…