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
Type casting | Intro to CS - Python | Khan Academy
Have you ever tried to make your print output a bit more descriptive, like this, only to get a type error? Why does that happen, and how do we fix it? Let’s put our debugging skills to work. We saw that my program last worked when I was just printing the…
The 2020 Recession | My Investing Concerns
What’s the guys? It’s Graham here. So I just want to have a really open, honest, and candid discussion about what’s been going on lately with the markets. The stimulus package is in place; what that means for you and my own thoughts about what’s likely to…
How to Get Sh*t Done with ADHD (even without meds)
If you got ADHD, you already know that mainstream advice like “just try harder” is pretty much useless. Honestly, not everyone understands what it’s like. Maybe you don’t have meds, or your family doesn’t even believe in ADHD and just thinks you are lazy.…
Mad Brad | Wicked Tuna
All right, we’re going to haul up now and come in. Weird fishing, there’s fish around. There’s a couple bites; you don’t mark that many. It’s just very strange. There’s a ton of boats out here; everybody’s trying to get their last licks in before the end …
Interactions within and among species | High school biology | Khan Academy
So let’s imagine that we are in the ocean, and we’re going to think a little bit about fish. We know that organisms usually are not just by themselves; there are other organisms around. There might be other members of their species around, and there are v…
8 steps to unf*** your life
Here are eight steps to un your life. Step one: cleanse thy Earthly vessel. Shower, get fresh, treat yourself with respect. Brush your teeth, wear a scent because this is it. This is the character you’re playing as, and if you fail to take care of yourse…