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
Harj Taggar - How Startups can Compete with FAANG Companies when Hiring Employees
[Music] Hey everyone, I’m Harj. I’m a partner at Y Combinator and I’m gonna answer the question of how do I hire someone who has competing offers from the big tech companies. There’s two ways I think you can compete with someone who has an offer from a …
Hydrogen bonding | Intermolecular forces and properties | AP Chemistry | Khan Academy
Let’s talk about hydrogen bonds. Depicted here, I have three different types of molecules. On the left, I have ammonia; each ammonia molecule has one nitrogen bonded to three hydrogens. In the middle, I have something you’re probably very familiar with. I…
Birth of the Vibrator | Original Sin: Sex
[Music] From the turn of the 20th century, sex has been literally electrified by technology. One of the first five electric gadgets, besides the sewing machine, fan, toaster, and tea kettle, was a plug-in sexual stimulator. The vibrator was a cure-all for…
The Two Mindsets That Can KILL Your Startup
And you feel like you’re strapped to this crazy person. You’re like, oh no, I’m like this. I’m in a car and the driver of the car is completely insane, and it’s going to take us all down. Yes, what have I done with my life? [Music] This is Michael Seibe…
How overstimulation is ruining your life
During certain periods of my life, I have a very difficult time focusing on pretty much anything important or difficult. During these periods, it seems almost impossible to break out of the social media limbo, where you’re just constantly switching betwee…
Buddhism | World History | Khan Academy
We’re now going to talk about one of the most significant figures in all of human history, and that is Sedara Gotha, who would later be known as Buddha, as the Awakened One or the Enlightened One. Now, before we get into his life, let’s think about the co…