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 Cult of Conformity in Silicon Valley
Who would want to be an early employee at imeem and Justin TV? Non-conformists, like, they would never be. You know a conformist would not be caught dead working at an early stage. This is Michael Seibel with Dalton Caldwell. Today, we’re talking about co…
The #USConstitution and founding of the presidency
How exactly did the founders of the United States first decide on how to choose the first president? Hi, I’m Leah from KH Academy. We’re celebrating this President’s Day by taking a look at how the US presidency is shaped in the US Constitution. There a…
The Face of the Revolution | Uncensored with Michael Ware
MICHAEL WARE (VOICEOVER): In Olympic boxing, Cuba is a heavyweight. The nation’s pride often rests upon success in the ring. Oh, my god. MICHAEL WARE (VOICEOVER): And few have known as much success as the man who has just walked in. What an honor to meet…
Innovative | Vocabulary | Khan Academy
Ah, hello wordsmiths! You found me in my workshop, coining new words— a little soldering, a little welding, and there you are, a brand new word! Let’s take it out of the forge and see what I’ve made. Oh, well, this word already exists—it’s Innovative. In…
Buddha - Conquer Fear, Become Free
In The Dhammapada, the Buddha says that a wise person is beyond fear and, as a result, is truly free. And there’s a Zen story that shares a similar message. During a Japanese civil war, an army was taking control of different villages. And in one village,…
How insurance works | Insurance | Financial literacy | Khan Academy
Let’s say that you have a car that right now is worth about ten thousand dollars. You don’t have ten thousand dollars as a cushion if, by chance, your car were to get totaled, or if it were to get stolen, or something were to happen. You don’t have an ext…