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
Lateral & total surface area of rectangular prisms | Grade 8 (TX) | Khan Academy
We’re asked what is the lateral surface area of the rectangular prism and then what is the total surface area of the rectangular prism. Pause this video, have a go at this before we do this together. All right, now let’s first focus on lateral surface ar…
Hindu scripture overview | World History | Khan Academy
As we’ve mentioned in previous videos, Hinduism is a very diverse religion with many different practices and even different beliefs. But there is a core centered around scripture, and the most important of these texts are the Vedas. Now, the word Veda lit…
Climate Change is Boring
Climate change is boring. Don’t get me wrong. It is incredibly important. It is just that the story of climate change is not especially compelling. And that is when the carbon dioxide concentration reached 400 parts per million. When I started making thi…
Capacitor i-v equations
We’re going to talk about the equations that describe how a capacitor works, and then I’ll give you an example of how these equations work. So, the basic equation of a capacitor says that the charge Q on a capacitor is equal to the capacitance value time…
Worked example: Calculating molar mass and number of moles | AP Chemistry | Khan Academy
We are asked to calculate the number of moles in a 1.52 kilogram sample of glucose. So, like always, pause this video and try to figure this out on your own. This periodic table of elements will prove useful. All right. Now, if we’re trying to figure out…
AK-47 Underwater at 27,450 frames per second (Part 2) - Smarter Every Day 97
Hey, it’s me, Destin. Welcome back to Smarter Every Day! So, I’ve been learning a lot about guns underwater, which is pretty cool. I mean, in the first video, I learned all about what’s happening back here in the action. But the problem is, because of lim…