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
At Night, This Bus Doubles As a Homeless Shelter | Short Film Showcase
[Music] Oh, make a lot of money. [Music] All right, you know this point out. Don’t lay it down, don’t put your feet on the seats. All right, you’re tired up against the window over there. Make it respectful for the next people that are getting off. They’r…
Remembering John Glenn: See Footage of His Legendary First Orbit of the Earth | National Geographic
Into the soft light of this Florida, Don emerges. Friendship 7 makes its debut to the day of its destiny. The Mercury Atlas stands long, waiting to depart this earth—a quarter of a million pounds of rocket, with thrust equal to three and a half million ho…
Senate confirmation as a check on the judicial branch | US government and civics | Khan Academy
When we think about how the executive or the legislative branch have some form of check or power over the judicial branch, a key element of that is the executive’s ability to appoint judges to federal courts, including the U.S. Supreme Court. But it’s not…
Species and the environment | Mechanisms of evolution | High school biology | Khan Academy
So we tend to view evolution and natural selection and the formation of new species, which is often called speciation, as a slow process that could take tens or hundreds of thousands of years, or in many cases millions of years. And that’s why it’s always…
This Empowering Memorial Honors the Legacies of Military Women | National Geographic
I remember vividly at the dedication 20 years ago of the memorial. There was a World War I veteran in her uniform who spoke. She said, “When I served in the Navy, women were not even allowed to vote.” I thought, what a brave woman! So in that hundred year…
Principles for Success: “The Five Step Process” | Episode 3
[Ray] Principles for Success: An Ultra Mini-Series Adventure in 30 minutes and in eight episodes. Episode three: The Five-Step Process. We’ve discussed how important it is to reflect carefully after experiencing pain. When I did this, I was usually able…