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
Principles for Success: "The Call to Adventure" | Episode 1
Principles for success: an ultra mini-series adventure in 30 minutes and in eight episodes. Episode 1: The Call to Adventure Before we begin, let me just establish the fact that I don’t know much relative to what I need to know. Whatever success I’ve ha…
Warren Buffett: A "Storm is Brewing" in the Banking Industry
Banks can take a lot of loan losses, but they can’t take something that wipes out their capital and expect the world to ignore that fact. If those rates change, let the person who bet that they wouldn’t change lose money. I mean, that’s if you make mistak…
How To Get Out Of A Funk | 5 Ways to Escape a Depressive Rut
Depression is a serious mental illness, and I am NOT a doctor, so if you are clinically depressed, get some professional help. But you don’t need to have clinical depression to feel like crap once in a while. In my life, I feel like I’ve lost my mojo, lik…
Which Way Is Down?
Hey, Vsauce. Michael here. Down here. But which way is down? And how much does down weigh? Well, down weighs about a hundredth of a gram per cubic centimeter. It is light and airy, which makes it a great source of insulation and buoyancy for water birds. …
Why MrBeast Philanthropy Will Never Save The World
Mr Beast has cured a thousand people of blindness, built a hundred homes for low-income families across the American continent, removed 33 million pounds of trash from the ocean, planted 20 million trees, and done much, much more. He might seem like a rea…
A Park Reborn: Close Encounter With a Lion | Nat Geo Live
( Intro music ) Bob Poole: One day this guy showed up. He was like nothing I’d ever seen before. We had no idea where he came from, but he was wild. You can tell a lot about a lion when you look in its face. What’s its life been like? The first time I fi…