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
The Story Behind Europe's Tallest Statue: The Motherland Calls | National Geographic
[Music] Mr. O’Reilly, 300ccs. Don’t name our canoes. No visible earth, it has the scale of America’s National Mall and the seriousness of Pearl Harbor. Combine them, and that’s what it feels like to visit Mammoth Gorgon, the memorial complex for the Batt…
Generational and lifecycle effects on political ideology | US government and civics | Khan Academy
What we’re going to talk about in this video is how political and cultural events might have an influence on someone’s political ideology. So let’s make this a little bit concrete. Political scientists will sometimes have various classifications for thes…
Mutations | Inheritance and variation | Middle school biology | Khan Academy
[Instructor] In this video, we’re gonna talk a little bit about mutations, and I wanna apologize ahead of time. My voice is a little strange today. I rode more roller coasters than I thought I would yesterday, and I screamed a little bit. But anyway, (c…
Peru Orphanage Update 2017 - Smarter Every Day 183
I can’t tell if it’s focused. Stay right there. Hey! It’s me, Destin. Welcome back to Smarter Every Day. This is my wife, Tara. My better half. [laughs] Every year in December, I make a video about an orphanage in Peru called Not Forgotten. Tara went down…
TIL: Whale Poop Freshens Our Air | Today I Learned
[Music] Did you know that every time you breathe you need to be grateful to whale poop? It’s true! Whales dive to the depth to feed, and then they come back after the [Music] surface. As they come back up to breathe, they poop. When they poop, they bring …
Nowruz and the Night Sky | Podcast | Overheard at National Geographic
[Music] At the age of around 13, I managed to borrow a telescope from a neighbor. I was trying to see some details of the moon, and as soon as I did the first look through this telescope, I think my whole life changed. Bobak Tafrishi is something of a noc…