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
Example constructing a t interval for a mean | Confidence intervals | AP Statistics | Khan Academy
A nutritionist wants to estimate the average caloric content of the burritos at a popular restaurant. They obtain a random sample of 14 burritos and measure their caloric content. Their sample data are roughly symmetric, with a mean of 700 calories and a …
The ULTIMATE Beginners Guide to making Passive Income Step-By Step
What’s up, you guys? It’s Graham here. So let’s talk about probably one of the most in-demand, most asked for, biggest topics on the history of the internet and YouTube, and that is making passive income. Now, I’ve said it before, and I’ve said it again,…
Function symmetry introduction | Transformations of functions | Algebra 2 | Khan Academy
[Instructor] You’ve likely heard the concept of even and odd numbers, and what we’re going to do in this video is think about even and odd functions. And as you can see, or as you will see, there’s a little bit of a parallel between the two, but there’s…
Changing Glaciers of Iceland | Explorers in the Field
(Slow piano music) I walk into a room and I tell someone I’m a glaciologist. Usually, someone looks at me and says, “Well, soon you’ll be a historian because the ice is going away.” We have the ability to turn this around, and I think we’re going to. We …
The Articles of Confederation | Period 3: 1754-1800 | AP US History | Khan Academy
Hey, this is Kim, and I’m here with Leah, KH Academy’s US government and politics fellow. Welcome, Leah! How’s it going? All right, so we’re talking about the Articles of Confederation, which I think many people don’t realize was the first Constitution o…
Anti-Natalism: The Argument To Stop Giving Birth
Suppose there is a couple, the Joneses, who just gave birth to a baby boy named Sammy. As they stand together in the hospital gazing down at their newborn, they share an awareness that the life ahead of Sammy will be filled with an indeterminable amount o…