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
Weird Inventions That Changed Humanity
Imagine you’re hooking up with different partners; you grow fond of some more than others, but generally, you’re having a good time. That is until your lovers start to fall ill and die. For some reason, this disease doesn’t affect you; it just kills off y…
Saving Manatees: What It Takes - Meet the Expert | National Geographic
So good to see you all again! I’m so excited for this time every week. Um, we get the opportunity to chat to a wonderful scientist, or expert, or conservationist live somewhere in the world, and we get to chat about some of their awesome research projects…
Warren Buffett: Why $100k is the MAGIC Number to Getting Rich (Life Changing Advice)
Listen closely because I’m about to let you in on the secret to getting rich. If you just clicked on this video, it’s fair to say that you want to one day become a millionaire. But what if I told you that the hardest part of becoming a millionaire isn’t h…
Introduction to Type I and Type II errors | AP Statistics | Khan Academy
What we’re going to do in this video is talk about type 1 errors and type 2 errors, and this is in the context of significance testing. So just as a little bit of review, in order to do a significance test, we first come up with a null and an alternative…
Charlie Munger's New Warning for the 2023 Stock Market
I used to come to the Berkshire annual meetings on coach from Los Angeles, and it was full of rich stockholders, and they would clap when I came into the coach section. I really like that. Holly mentioned Warren Buffett’s right-hand man, the vice chairma…
Exploring the Ocean for Sixty Years | Best Job Ever
Even if you’ve never seen the ocean or touch the ocean, the ocean touches you with every breath you take, every trough of water you drink. It’s the ocean. It’s the ocean for me. Being a biologist, just following my heart has led me to some fascinating pl…