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
3d curl intuition, part 1
Hello everyone. So, I’m going to start talking about three-dimensional curl, and to do that, I’m going to start off by taking the two-dimensional example that I very first used when I was introducing the intuition. You know, I talked about fluid flow, and…
Ray Dalio: The COLLAPSE That Will Change a Generation
Ray Dalio is one of the most highly respected names in investing, and someone you need to be paying attention to. As the founder of Bridgewater, the world’s largest and arguably most prestigious hedge fund, he has unique insight into the economy and stock…
Why You Should NOT Buy A Home In 2022
What’s up, Graham? It’s guys here, and welp, it’s official. We are setting records, but unfortunately, it’s probably not for the best of reasons. It was just reported that housing affordability is nearing the worst it’s ever been in history, and as a resu…
What Lies Beneath London’s Liverpool Rail Station? | National Geographic
[Music] People are surprised about what lies beneath London, especially when they find human remains. The Liverpool Street Station is one of the most important for archaeology because we’re right in the heart of the ancient city here. The cemetery was in …
Vector word problem: resultant force | Vectors | Precalculus | Khan Academy
We’re told that a metal ball lies on a flat horizontal surface. It is attracted by two magnets placed around it. We’re told that the first magnet’s force on the ball is five newtons. We’re then told the second magnet’s force on the ball is three newtons i…
Roe v. Wade | National Constitution Center | Khan Academy
Hi, this is Kim from Khan Academy. Today we’re learning more about Roe versus Wade, the 1973 Supreme Court case that ruled that the right of privacy extends to a woman’s decision to have an abortion. To learn more about Roe versus Wade, I spoke to two exp…