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
FLY | Trailer (IMAX) | National Geographic Documentary Films
Freaking out, you shake him and give me 10 seconds. Okay, okay, have a nice one. Okay, 3, 2, 1! There’s this feeling when you left the object; it’s a form of just absolute bliss, and you want it again, and you want it again. When Jim and I started jumpin…
2015 AP Calculus BC 2b | AP Calculus BC solved exams | AP Calculus BC | Khan Academy
[Voiceover] Part b. “For zero is less than t is less than one, there is a point on the curve at which the line tangent to the curve has a slope of two.” The line tangent to the curve has a slope of two. “At what time is the object at that point?” So, the …
Harmonic Functions
Hello everyone. So, here I’d like to talk about harmonic functions. Now, harmonic functions are a very special kind of multivariable function, um, and they’re defined in terms of the Laplacian, which I’ve been talking about in the last few videos. So, th…
Charlie Munger's 10 Secrets to Getting Rich
A lot of questions today. People trying to figure out what the secret to life is to a long and happy life. And I just wonder if you were—that is easy because it’s so simple. What is it? Don’t have a lot of envy. You don’t have a lot of resentment. You don…
Hiroshima Photo Walk | National Geographic
My name is David Gutenfelder, and I’m a photographer with National Geographic magazine. I’m here on assignment with Mazda in Hiroshima, Japan. I’m a true believer in the power of photography. I want people to see my photographs, and I want them to be tran…
The Beauty of Three
Humans are a beautiful but weird species. As evolved as we are, we still struggle with the simplest things like chaos and chance. Our brains are constantly trying to recognize patterns to create meaning and order to things that oftentimes are just random.…