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
Inflation Continues to Sky Rocket: How Warren Buffett Says You Should be Investing
Everyone is talking about inflation, inflation, inflation, inflation. This pesky little thing called inflation has probably been the most talked-about topic in finance this year, and this is likely for a good reason. The cost of mostly everything, from ho…
First-Ever 3D VR Filmed in Space | One Strange Rock
I spent a hundred and sixty six days off the world, but somewhere along the way my perceptions of the world shifted. [Music] When you’re onboard a spaceship, you’re very much aware of the passage of time. The clock is running, your heart is beating, your…
The Journey of Self Discovery: Uncovering Your True Identity
Every day you cross paths with countless strangers. People sit next to you on the bus; you’re a cashier at the grocery store, sends you a smile, and someone works out beside you at the gym. Often, these faces pass us by; there’s nothing particularly disti…
BONUS: The Oxford comma | Punctuation | Grammar | Khan Academy
Hey grammarians, hey Paige, hi David! So, we’re going to talk today about the Oxford comma, which is just another word for another name for the serial comma. This is normally when you have a list of things; you punctuate them with a comma after each item…
Derivatives of inverse functions | Advanced derivatives | AP Calculus AB | Khan Academy
So let’s say I have two functions that are the inverse of each other. So I have f of x, and then I also have g of x, which is equal to the inverse of f of x, and f of x would be the inverse of g of x as well. If the notion of an inverse function is comple…
Don’t Worry, Everything is Out of Control | Taoist Antidotes to Worry
Our busy lives often lead to feelings of stress, exhaustion, and even burnout. Stress is one of the major causes of illness and can also lead to depression and anxiety. Luckily, the writings of ancient Taoist sages offer plenty of philosophical ideas that…