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
Functions continuous on all real numbers | Limits and continuity | AP Calculus AB | Khan Academy
Which of the following functions are continuous for all real numbers? So let’s just remind ourselves what it means to be continuous, what a continuous function looks like. A continuous function—let’s say that’s my Y-axis, that is my X-axis—a function is …
COVERED IN CHICKS -- IMG! #41
A rooster… cat? And Ronald orders a number three. It’s episode 41 of IMG! City life. Oh hi. And here’s a necktie that’s formal and manly, though, of course, I prefer one piece cat faces. Too much coverage? Well, try on one of these or just wear a slice of…
Rob Riggle Ice Climbing in Iceland | Running Wild With Bear Grylls
BEAR GRYLLS: OK, Rob. Your front points– your crampons are your main weight-bearing things. Good lord. BEAR GRYLLS (VOICEOVER): Comedian Rob Riggle and I are in a race against time, searching to find a case of supplies before nightfall. But first, we’ve …
My minimalist productivity setup
[Music] Welcome to where the magic happens. You’ve seen this place before, mostly in the background of these a-roll shots and in b-roll shots where I’m either wasting time or being productive—the only two types of b-roll shots on this entire channel. But …
I watched the Eclipse in Argentina - Smarter Every Day 221
Hey, it’s me, Destin. Welcome back to Smarter Every Day. I am in the globe museum in Vienna, Austria, and going to show you something really neat. This is called a Lunarium. A Lunarium is a really interesting device used to calculate the position of solar…
World's First Electric Generator
[Applause] I have a pipe. Yeah, do you want to hold it? Do you know what it’s made of? Metal. Is it brass? Copper? Coer? Is copper magnetic? No? Uh-oh. I’m going to go. No, I didn’t think it was. Go, yes! I’m going to go. Yes! Well, why don’t we check? Th…