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
Fishin' Frenzy Makes Their Own Path | Wicked Tuna: Outer Banks
[Music] Where are the fish, man? See anything spectacular? I see a lot of water, see a lot of other boats. Yeah, there’s no tuna though. The spot we’re at was hot the last couple days, but apparently it’s all dried up. It makes it extremely difficult for…
Apocalypse | A Pastor, A Rabbi and an Imam | The Story of God
Okay, so stop me if you’ve heard this one: a rabbi, a pastor, and an imam walk to a bar. Okay, so it wasn’t a bar; it was a diner to discuss my show, “The Story of God,” about the apocalypse. So the rabbi says, “Share with me a little bit about how the I…
The Fifth Amendment | The National Constitution Center | US government and civics | Khan Academy
Hi, this is Kim from Khan Academy, and today I’m learning more about the Fifth Amendment to the U.S. Constitution. The Fifth Amendment is one of the better-known constitutional amendments since we frequently hear references to suspects taking the Fifth in…
Spaceship You
Pandemic season. This is not the first, nor will it be the last time you lock yourself down and we isolate from each other to protect ourselves and to protect those more vulnerable than ourselves. The practical effect of this isolation on you is that your…
The Role of Role Models | StarTalk
[Music] It’s often said that it’s easier to be something if you can see it; if you can imagine yourself in that position. Role models have always played an important role in that. Role models have that role. I have a slightly contrarian view of role mode…
How to Apologize Like an Influencer
The apology video is a rite of passage for almost every influencer with a decent following. For people like you and me, public cancellation is usually nothing but a short-lived spectacle. But for an influencer, it’s an occupational hazard with potentially…