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
15 Expensive Things That Are Worth The Money
Remember the banana duct tape to a wall that sold for 120,000? Yeah, okay, not everything that’s expensive is worth the money, but some things are. When you finally get rich, you’ll want to know where you should focus your spending. So here are 15 expensi…
Cathode Rays Lead to Thomson's Model of the Atom
So today, I’m at the University of Sydney with Doctor Phil Dooley, and we’re talking about how our idea of the atom changed from a tiny little hard sphere to something more complicated. And this apparatus has something to do with that. Phil: Exactly, exa…
Antarctic Wind Beneath My Wings | Continent 7: Antarctica
[music playing] Oh, what’s it doing? It’s still pointing in the right direction? It’s drifting towards us. NARRATOR: Paul is flying the climate team’s $80,000 drone system. And it’s fighting so much wind, it just can’t handle it. NARRATOR: And the winds…
The importance of regular tracking | Banking | Financial Literacy | Khan Academy
So your bank account, and you might have more than one, is really where a lot of your financial life is happening. So it’s important to keep track of it, and we’re going to talk more about that in this video. I’d recommend looking at the transactions in,…
The stoic idea that will make you unstoppable
So pretend you’re stuck in traffic. You’re super frustrated. You’re gripping the wheel tight. You can’t believe that you’re late for work and it’s your first day. You just landed your dream job, and it’s bumper-to-bumper traffic. You can’t do anything abo…
How To Make Friends
Friends make life good. They provide the scaffolding that makes it not just bearable, but fun. They give us a sense of meaning and purpose and are a source of security, self-esteem, and happiness. Almost nothing predicts how happy you will be as how conne…