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
The Making of 'Genius' | National Geographic
Genius is the first scripted series on Matt Gio. The first season of Genius is the story of Albert Einstein, which we’re telling over the course of 10 episodes. We all know, uh, of his genius, his gifts, but Albert Einstein’s private life is far more comp…
Wormholes Explained – Breaking Spacetime
If you saw a wormhole in reality, it would appear round, spherical, a bit like a black hole. Light from the other side passes through and gives you a window to a faraway place. Once crossed, the other side comes fully into view with your old home now rece…
Human migration: sub-Saharan Africa and the Pacific | World History | Khan Academy
In this video, I want to explore the question of what impact does the environment have on human migration. We have a couple of specific examples here, and before we dig into those, I want to make a few broader points about the environment as a historical …
Conditional probability and independence | Probability | AP Statistics | Khan Academy
James is interested in weather conditions and whether the downtown train he sometimes takes runs on time. For a year, James records weather each day: is it sunny, cloudy, rainy, or snowy, as well as whether this train arrives on time or is delayed. His re…
Cracking Down on Cheetah Traffickers | Podcast | Overheard at National Geographic
So as they’re coming in, you hear these cheetah cub chirps echoing through the courtroom in the late afternoon of a hot day in Hargesa. The capital of Somaliland, National Geographic Animals Editor Rachel Bale sat in on an unusual trial. Was the proceedin…
Thank you for an amazing year!
That’s, that’s, I started selling jets over 40 years ago, and a lot has changed since those early days. But one thing I really didn’t see coming is this: me sharing my life to millions across the world and you guys tuning in week in and week out. It was …