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
Origins of the Dragon | StarTalk
How good could be unless it’s got dragons? It’s no fantasy unless you have a dragon. Yeah, you need the dragon. Yeah. You need the dragons. And in my home institution, the American Museum of Natural History, we had an exhibit a few years ago that was al…
Why Ellen May Never Be on Shark Tank!
All right, who here watches Shark Tank? Do you like that show? Shark Tank? I love that show! I love that show! It’s on tonight, and if you haven’t seen it, it’s where inventors pitch their products to investors. A few weeks ago, they asked me to be a gue…
Go with what you can get started on most quickly. And get that first user.
Here’s a question: I have lots of startup ideas. How do I choose the one to work on? Uh, common problem. There’s too many choices; there’s lots of choices in the world. You don’t know what to focus on. You know, there’s different algorithms you can use.…
Exploring Ciudad Perdida | Lost Cities With Albert Lin
[music playing] ALBERT LIN: It’s literally a city in the clouds. Maybe those Spanish stories weren’t just legends because that’s what a real lost city looks like. HELICOPTER PILOT: [inaudible] 1 0 1 2. ALBERT LIN: That’s Ciudad Perdida, the Lost City. …
Tax multiplier, MPC, and MPS | AP Macroeconomics | Khan Academy
So in this video we’re going to revisit another super simple economy that only has a farmer and a builder on an island, and we’re going to review what we learned about the multiplier and the marginal propensity to consume. But we’re going to do it a littl…
Subtracting rational expressions: unlike denominators | High School Math | Khan Academy
So right over here we have one rational expression being subtracted from another rational expression. I encourage you to pause the video and see what this would result in, so actually do the subtraction. Alright, now let’s do this together. If we’re subt…