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
How to Understand What Black Holes Look Like
On Wednesday, April 10th, 2019, you will probably see the first-ever image of a black hole. That’s when the Event Horizon Telescope will be releasing their results, and I haven’t seen them yet, but I think they’re going to look something like this. I can …
Interpreting equations graphically | Mathematics III | High School Math | Khan Academy
Let F of x = 3x - 5 and g of x = x^3 - 4x^2 + x + 6. The graphs of y = F of x and y = G of x are shown below, and we see them right over here. This y = F of x is in, that is, in that purplish color. Let me see if I can get that same purplish color so tha…
Lunar Eclipse 101 | National Geographic
(bright music) - [Narrator] A lunar eclipse happens when the earth blocks some or all of the sun’s direct light from reaching the moon. This cosmic event only takes place during a full moon, which happens once every 29 and a half days, or the length of on…
Carolynn Levy And Panel (Jon Levy, Jason Kwon) - Startup Legal Mechanics
I would like to introduce my colleague Carolyn Levy to my right here, who’s going to talk about startup mechanics, and then with John Levy and Jason Quan they’ll answer some questions about getting your startup started, legal issues. I will point out that…
How Gossip Builds Stronger Teams and Prevents Bullying #Shorts
In 2014, Sanford Professor Rob Willer led a study that explored the relation of gossip and ostracism to the harmony and functionality of experimental groups. In this study, Rob found out that groups that allowed their members to gossip and fold out underp…
Even & odd polynomials | Mathematics III | High School Math | Khan Academy
[Voiceover] So, we have three functions here. What I want to do together is think about whether each of these functions are even or odd. And just as a little bit of a reminder, for an even function, if you were to input -x into the function, it’s the sa…