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
Khan Academy Ed Talks with Judy Heumann
Hello and welcome to Ed Talks with Khan Academy. I’m Kristen DeCervo, the Chief Learning Officer here at Khan Academy, and today I am excited to welcome Judy Heumann, who is an international disability rights activist. I look forward to talking to her abo…
Composing 3x3 matrices | Matrices | Precalculus | Khan Academy
So, we have two three by three matrices here: matrix A and matrix B. We could, of course, view each of them as a transformation in three-dimensional space. Now, what we’re going to think about in this video is the composition of A and B. So, you could th…
Citizens United v. Federal Election Commission | US government and civics | Khan Academy
This is Sal here with Rick Hassan, who’s a professor of law at UC Irvine School of Law specializing in election law. I’m here with Bradley Smith, who’s former chairman of the Federal Election Commission. He’s also a professor of law at Capital University …
Proof for the meaning of Lagrange multipliers | Multivariable Calculus | Khan Academy
All right, so last video I showed you guys this really crazy fact. We have our usual setup here for this constrained optimization situation. We have a function we want to maximize, which I’m thinking of as revenues for some company; a constraint, which I’…
Take a Tour of a Soviet-Era Ghost Town at the Edge of the World | Short Film Showcase
[Music] [Music] I knew about the existence of Pyramidan since middle school. This strange Russian settlement is out of Russia, far behind the Arctic Circle. I never thought of visiting it because, uh, I knew that it’s a ghost town, so nobody lives here, a…
Alien Oceans | Explorers in the Field
(peaceful music) When I was a kid looking up at the stars, I really always wondered how did we get here and are we alone? My name is Bethany Ehlmann. I’m a professor of planetary science at Caltech and Research Scientist at the NASA Jet Propulsion Labora…