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
Change in expected future prices and demand | Microeconomics | Khan Academy
We’ve been talking about the law of demand and how if we hold all else equal, a change in price affects the quantity demanded. If price goes up, the quantity demanded goes down, and if price goes down, the quantity demanded goes up. So, if you hold all el…
8 Surprising Facts
Hey, Vsauce. Michael here… Coming to you from the Barbican in London. It’s beautiful, it’s like living inside the Regenstein Library. That’s a concrete joke. But, I’ve put together a leanback of videos all around YouTube that I really like, that I host a…
Spinning Disk Trick Solution
[Applause] So, in the spinning disc trick we saw that an asymmetrically weighted disc, when spun, actually flips so that the lighter side goes towards the bottom. Now, this is a variation on something called the tippy top, a little spinning toy that spins…
Unraveling a Mapmaker’s Dangerous Decision | Podcast | Overheard at National Geographic
So I told them that they didn’t have a chance, and for the sake of their wives and children, they should vacate the area and go back. Both of them sunk, and at that time I heard the cocking of weapons. Once both of them cocked their weapons, I knew they m…
Worked example: Using bond enthalpies to calculate enthalpy of reaction | Khan Academy
[Educator] Bond enthalpies can be used to estimate the standard change in enthalpy for a chemical reaction. Let’s use bond enthalpies to estimate the enthalpy of combustion of ethanol. Looking at our balanced equation, we have one mole of ethanol reacti…
3 rules to quickly improve your life
Okay, so here are three rules to live by that will quickly improve your life. Rule number one: Follow the path of most resistance. Now, this obviously isn’t an absolute rule. Like, you probably have a lot of resistance towards driving into oncoming traff…