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
Unpacking employee benefits | Employment | Financial Literacy | Khan Academy
When looking at a new job, it can be very tempting to look only at the pay. That’s because the pay is really important, and that’s the bulk of what the company is going to give you. But there are other things that they will give you beyond pay that you sh…
Dining alone at a fancy Japanese restaurant-#Nobu
[Music] Do you want to just like wave so the charge is good? Good morning! Good morning! Ah, I’m dying. Hi guys, it’s me, Dory. Today we’re gonna have a chill med school slash me having a solo dinner in Nobu vlog. The footages of the videos are actually …
Position-time graphs | One-dimensional motion | AP Physics 1 | Khan Academy
What we’re going to do in this video is think about different ways to represent how position can change over time. So one of the more basic ways is through a table. For example, right over here in the left column, I have time—maybe it’s in seconds—and in…
How To Embody A MILLIONAIRE'S Lifestyle | Kevin O'Leary
I keep telling everybody every time we talk about investing, the key is diversification. I feel good about the expense, but I also feel good from an investment strategy that it’s not just frivolous and stupid; that I needed to get my money back out of it.…
Big Bend's New Bear Cubs | America's National Parks | National Geographic
NARRATOR: Nearly 6,000 feet up in the mountains, another mom has a huge challenge. A female black bear has spent the winter in a high mountain cave. She needs to teach her cubs to survive in the park. With little to no food or water for months, the stakes…
Sonic Postcards from The Appian Way | Podcast | Overheard at National Geographic
That was our first experience with an unpassable section of the Appian Way. We were with Ricardo at that point. Ricardo told us the path is not clear, so probably we have to cross the river. But let’s see. Writer Nina Strolik and photographer Andrea Fraz…