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
Can You Solve This Shadow Illusion?
We have that card with a little round hole in it, and what I want you to do is hold it up, um, and try to cast a shadow on that wall there. I want you, before you do it, to predict what we’re going to see. Shadow of the card? Shadow of the card with a lit…
How I sold my first house at 19 for $3,550,000
So it took me about 10 months to sell my first house. 10 months. Well, honestly, I believe that after like month 8, I’m like, this is impossible! Like, how does anyone ever sell a house? I’ve been doing everything I can and I just can’t seem to get any re…
Enzyme reaction velocity and pH | Cellular energetics | AP Biology | Khan Academy
In this video, we’re going to talk about enzymes. In particular, we’re going to talk about the effect of pH on enzymes—how acidic or basic the environment is and how that affects enzyme activity. So just as a bit of review, enzymes are molecules that hel…
How AI, Like ChatGPT, *Really* Learns
The main video is talking about a genetic breeding model of how to make machines learn. This method is simpler to explain or just show. Here is a machine learning to walk, or play Mario, or jump really high. A genetic code is an older code, but it still c…
Linkage institutions and political parties | US government and civics | Khan Academy
In many videos, we have talked about the makeup of government at either the federal or the state level. We’ve talked about branches of government; we’ve talked about checks and balances. What we’re going to talk about in this video is how people interface…
Lecture 8 - How to Get Started, Doing Things that Don't Scale, Press
Yeah, thanks for having me, Sam. Um, I’m Stanley. I’m the founder of DoorDash, and it’s really amazing to be here because it wasn’t actually that long ago where I sat in your seats. Um, I was class of 2014, graduated in CS, as well as my co-founder Andy. …