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
Connecting period and frequency to angular velocity | AP Physics 1 | Khan Academy
What we’re going to do in this video is continue talking about uniform circular motion. In that context, we’re going to talk about the idea of period, which we denote with a capital T, or we tend to denote with a capital T, and a very related idea, and th…
My thoughts on Robert Kiyosaki
What’s up you guys, it’s Graham here. So if you’re anything like me, you’ve noticed an unusually high amount of Robert Kiyosaki videos being recommended right now on YouTube. Like, it seems as though every single time I open up the homepage, there’s a fre…
Llamas Bring Happiness to Nursing Home | National Geographic
If you had someone and you said, “Let’s go look at a llama,” the llama’s coming in the building. My gosh! When does a llama come in the building? As soon as they see Travis in the building, everybody just wants to touch him repeatedly. Even when you come …
2015 AP Physics 1 free response 1a
Two blocks are connected by a string of negligible mass that passes over a massless pulley that turns with negligible friction. It is shown in the figure above. We see that the mass M2 of block 2 is greater than the mass M1 of block 1. The blocks are rele…
Constant of proportionality from tables | 7th grade | Khan Academy
We are asked which table has a constant of proportionality between y and x of 0.6. Pause this video and see if you can figure that out. All right, so just as a reminder, the constant of proportionality between y and x, one way to think about it is that y…
Classifying shapes by lines and angles | Math | 4th grade | Khan Academy
Which shape matches all three clues? So here we have three clues, and we want to see which shape down below matches all three of these statements. So let’s start with the first clue. The first clue says the shape is a quadrilateral; “quad” meaning four-s…