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
How to stop quarantine from ruining your life
When self-isolation first started, I was like, “You know what? This is gonna be a piece of cake! I work from home, I’m at home all the time, this should be a cakewalk.” [Applause] [Music] It was a lot harder than I thought it would be, especially at the b…
9 WAYS TO DESTROY YOUR ENEMY WITHOUT FIGHTING | STOICISM INSIGHTS
If you’ve ever felt like someone was against everything you said or did solely to attack you, there’s a story about fireflies being pursued. The firefly flew for a long time, attempting to escape, until he reached a dead end, nearly being caught. He asked…
1920s urbanization and immigration | Period 7: 1890-1945 | AP US History | Khan Academy;
[Narrator] During the Gilded Age, the population of the United States had started to shift sharply towards living in urban rather than rural environments. In 1900, 1⁄3 of the American population lived in cities, drawn by the wide availability of factory j…
If superpowers were real, which would you choose? - Joy Lin
What if I could fly? What if I could live forever? What if I could be invisible? What if I could lift a tank? For ages, people have craved for answers to these questions, and what unbelievably gratifying way that we have used to express our fantasies is t…
The FED Just Broke The Market | Dollar Crisis Explained
What’s up guys, it’s Graham here. So, despite the Federal Reserve’s best attempt to bring down prices, as of yesterday, inflation came in at a whopping 8.2 percent, which was significantly higher than expected and a sign that things might continue getting…
Joel McHale in a Slot Canyon | Running Wild With Bear Grylls
[music playing] OK, this is going to be tight. BEAR GRYLLS (VOICEOVER): Comedian and actor Joel McHale and I are trying to navigate a deep slop canyon in the Arizona desert. Oh my god. BEAR GRYLLS (VOICEOVER): But it just became dangerously narrow. Oh…