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
Rising Ocean Temperatures are "Cooking" Coral Reefs | National Geographic
Foreign. We’ve now had three major bleaching events on the Great Barrier Reef: in ‘98, 2002, and again just recently in 2016. We zigzagged along the whole length in a helicopter and fixed-wing plane. We put about 100 people underwater. The extent and sev…
Craig Cannon on Podcasting with Adora Cheung
Welcome! I am Adore Chun. I’m a partner at Y Combinator, and I am here interviewing Craig Kenan. How’s it going? Good, how are you doing? I’m doing very well, great! Thanks for being here and for being on your own podcast. No problem! I had a great ti…
Production Possibilities Curve as a model of a country's economy | AP Macroeconomics | Khan Academy
Let’s say that we have some country, let’s call it Utense Landia, that can only produce one of two goods or some combination of them. So it can produce forks, and it can produce, or it could produce, spoons. This axis is the quantity of forks; this axis i…
Interactive Innovations | Epcot Becoming Episode 3 | National Geographic
We’re pushing technology within our ride systems, showing that we can create amazing things together. Frozen Ever After was really the first attraction to use all electric motor audio animatronics figures. Traditionally, all of the audio animatronics figu…
Kevin O'Leary: Harvard's Most Controversial Case Study?
At Harvard, why this is Kevin O’Leary building a brand in shark-infested waters? It’s a Harvard case about Mr. Wonderful. I can’t believe it; it’s surreal. Of course, I’m honored, no question about it. The whole story is in here, the whole Mr. Wonderful s…
Misconceptions About Heat
Today I’m going to bake this chocolate cake. Now those of you who know me know that the only reason I would do this is to prove a point. Earlier I was asking people to compare the temperatures of these two objects: a science book written by Isaac Asimov a…