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
Surviving a Coyote Ambush | Something Bit Me!
Ambushed on a desolate road at night, Andrew repels a coyote attack, but the coyote isn’t alone. As soon as I hit the initial coyote on the head with the flashlight, that’s when the other two, you know, saw the aggression from me and started to attack. It…
Quantitative electrolysis | Applications of thermodynamics | AP Chemistry | Khan Academy
We already know that in an electrolytic cell, current or movement of electrons is used to drive a redox reaction. If we look at a generic reduction half-reaction, the stoichiometry of the half-reaction shows how many electrons are needed to reduce a gener…
Homeroom with Sal & Jeffrey Rosen - Thursday, September 17
Hi everyone, welcome to the homeroom live stream! Sal here from Khan Academy. A happy National Constitution Day for all of y’all from the United States. We’ll be digging deep into the U.S. Constitution with one of the world’s leading experts on it. So, st…
Pedigree for determining probability of exhibiting sex linked recessive trait | Khan Academy
We are told the pedigree chart represents the inheritance of color blindness through three generations, and we see this here. The standard convention is a square is male, a circle is female. If it’s colored in, that means that they exhibit the trait; in t…
How Dax Flame Became Famous
After I graduated high school, I acted in movies. I acted in Project Decks, so then I got recognized from that, but mostly from 21 Jump Street, which I acted in the following year. So after they were released, I went and traveled a lot, and I wrote a boo…
Meet The $700,000,000 Man Who Lost Everything | Dave Ramsey
I’m an entrepreneur. This is going to work. It didn’t. It didn’t. It didn’t. It didn’t. It didn’t. And then you put something out there that you kind of thought, “Yeah,” and then it goes big and you got, “Crap, I don’t know nothing.” You know, so you just…