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
City So Real | Official Trailer
[Music] Hello, yes, I’m doing a documentary right now. Could you please give me a call back? What do I think about the city? I actually love it and hate it. That’s Chicago, though. It’s our one big happy family. The cries and the complaints of the people …
Adding the opposite with number lines | 7th grade | Khan Academy
So, this number line diagram here, it looks like I’m adding or subtracting two numbers. I’m starting with what looks like a positive nine. I’m starting at 0 and going nine units to the right, so that’s a positive nine. To that, it looks like I might be a…
16 CLEVER Flash Games!
Hello, Vsauce! Michael here, and today I have 16 more creative games just for you. So why wait? Let’s hit the ground running! Or rather, DJing. Record Tripping takes the feeling and live soundtrack mixing of scratching a record with your scroll wheel and…
The Mummification of Seti I | Ultimate Treasure Countdown
[music playing] NARRATOR: Seti the First was the father of our friend Ramesses the Great. Just like his son, he was a hugely successful pharaoh. But in father-son rivalry, there’s one category where he wins hands down: his mummy. Because Seti the First b…
8 Habits keeping you Poor - Marcus Aurelius | STOICISM INSIGHTS
Every morning, millions of us wake up, grab our phones, and immediately start scrolling through a sea of notifications, messages, and updates. It’s the first thing we do, almost instinctively, as if our smartphones hold the secret to starting the day righ…
Warren Buffett Just Made a Huge Bet on a Hidden Stock.
Warren Buffett has very sneakily just made a rather sizable bet on a new stock, and it’s not your typical Buffett-style investment, like what he did last year with Activision Blizzard stock. Buffett has just placed another big Arbitrage bet that a certain…