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
You Have to Protect Your House! | Life Below Zero
You don’t know when something unique is going to happen out here, but you better be on your toes. There he is, he’s on top of my Ridge now. After a brief stay in Dead Horse, SE has returned home to find a Wolverine lurking around CIC’s perimeter. To prot…
Life lessons in the Alaskan wilderness | Alaska: The Next Generation
Gotta have a subsistence lifestyle way to live out here. We eat from the sea. From the birds. Not really other ways to, uh, get food around here. Salmon only comes once a year and, uh, gotta try and the time they come around. Argh. Come on fish. You see a…
How to sell a $24,000,000 private jet.
He wants a 550 and a 450. He wants to spend the budget total amount for two aircraft, maybe 20 to 25 million range. 550, he said, instead of buying your 450 as a second aircraft, we might end up buying two 550s. Right? He just saw one of your ads. I beli…
Using recursive formulas of geometric sequences | Mathematics I | High School Math | Khan Academy
The geometric sequence ( a_i ) is defined by the formula where the first term ( a_1 ) is equal to -1⁄8 and then every term after that is defined as being so ( a_i ) is going to be two times the term before that. So, ( ai ) is ( 2 \times a{i-1} ). What is…
Africa's Mightiest Meat Eaters | Meet the Lions of Animal Kingdom | Magic of Disney's Animal Kingdom
At Disney’s Animal Kingdom theme park, day dawns for Africa’s mightiest meat eaters. Alright, are you ready to shift 1.2 line on show? Have a great day. Three majestic lions rule this savanna. You normally see them walk their whole perimeter and set mark…
Covalent bonds | Molecular and ionic compound structure and properties | AP Chemistry | Khan Academy
In a previous video, we introduced ourselves to the idea of bonds and the idea of ionic bonds, where one atom essentially is able to take electrons from another atom. But then, because one becomes positively charged and the other becomes negatively charge…