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
Mean of sum and difference of random variables | Random variables | AP Statistics | Khan Academy
Let’s say that I have a random variable X, which is equal to the number of dogs that I see in a day. Random variable Y is equal to the number of cats that I see in a day. Let’s say I also know what the mean of each of these random variables are, the expec…
Are you here to please others? Well, I’m not.
Imagine waking up on an ordinary morning, only to discover that your reflection in the mirror has become alien, monstrous. Your limbs, once familiar, have morphed into spindly, insect-like protrusions, and a hard, shiny shell covers your flesh. In Franz …
Why I'm NOT Investing in Bitcoin! | Shark Tank's Kevin O'Leary & Anthony Pompliano
You you and I originally clashed, if you want to call it that, around a topic that you’re so engrained with. It’s part of your brand; it’s bitcoin. I’m like everybody else saying, “If it works, I should own some,” but frankly all I’ve seen so far is volat…
Commas and introductory elements | Punctuation | Grammar | Khan Academy
Hello, grammarians! Uh, Paige and I are here to teach you about introductory elements in sentences and how commas relate to them. Paige, what, how do we—how should we define what an introductory element is? So, it’s pretty much, uh, something that happe…
Why I'm Selling
What’s up guys, it’s Graham here. So, as most of you know, since I’ve started the channel and really for the last 10 years, I’ve dedicated the majority of my efforts and my money towards investing in real estate, with a lot of it documented here in the ch…
Elon Musk : How to Build the Future
Today we have Elon Musk. Eon, thank you for joining us. Thanks for having me. Right, so we want to spend the time today talking about your view of the future and what people should work on. So, to start off, could you tell us you famously said when you…