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
Finding the end time for a movie in 24 hour time | Math | Khan Academy
We are told that Andre goes to a movie that starts at 19 hours 45 minutes, or 1945, and is 90 minutes long. What time is the movie finished? So pause this video and see if you can answer that before we work through it together. All right, so what I like …
Triple bonds cause linear configurations | Organic chemistry | Khan Academy
I want to do a quick clarification on the video on alcohols. In one of the videos, I gave this example of this alkanol right over here. It has a triple bond between the five and six carbons, and I just want to clarify that in reality, it would not ever be…
Derivatives of sec(x) and csc(x) | Derivative rules | AP Calculus AB | Khan Academy
In a previous video, we used the quotient rule in order to find the derivatives of tangent of X and cotangent of X. What I want to do in this video is to keep going and find the derivatives of secant of X and cosecant of X. So, let’s start with secant of …
Beat frequency | Physics | Khan Academy
What’s up, everybody? I want to talk to you about beat frequency, and to do so, let me talk to you about this air displacement versus time graph. So this is going to give you the displacement of the air molecules for any time at a particular location. So…
Wood Yearning Life Below Zero
Coming with me, getting a boat, dog. I’m gonna go down river. I’m gonna go get firewood, and I’m gonna take my chainsaw. I’m gonna hunt and kill trees, and I’m gonna come back here with some tree flash. Come on, good girl. The hailstones spend their summ…
Organism life history and fecundity | Ecology | Khan Academy
We’re going to talk about in this video is what I consider one of the most fascinating subjects in biology, and that’s the variation we see from species to species in life histories and life spans and their rate of reproduction. For example, we have thre…