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
2015 AP Physics 1 free response 1c
Let’s now tackle part C. They tell us block three of mass m sub 3, so that’s right over here, is added to the system, as shown below. There is no friction between block three and the table. All right, indicate whether the magnitude of the acceleration of …
Alex Honnold Rappels The Moulin | Arctic Ascent with Alex Honnold | National Geographic
[Alex] Deep enough that it just turns black. [Heidi] Yeah. [Alex] Yeah, it’s pretty far. [Heidi] This huge hole is called a moulin. It acts like a drain, funneling meltwater to the base of the glacier. This is the abyss; it’s all pretty big and pretty int…
Graphs of rational functions: vertical asymptotes | High School Math | Khan Academy
[Voiceover] We’re told, let f of x equal g of x over x squared minus x minus six, where g of x is a polynomial. Which of the following is a possible graph of y equals f of x? And they give us four choices. The fourth choice is off right over here. And l…
Lion Falls From Tree During Rescue From a Wire Snare Injury | National Geographic
We pretty much picked up on finding that Orinda at a point where she was treated about two weeks back. So even though the snare was removed, we saw that over about a two and a half week period, her conditions started again to rapidly decline. So we find …
Storytelling on Steroids: Quick Cuts and Relentless Editing #Shorts
Videos feature nauseatingly quick cuts and rapid-fire text, and they’re always trying to hook you with forced uncertainties, making you wonder what will happen next or how something will play out. Most media works this way, but this is storytelling on ste…
How the Quantum Vacuum Gave Rise to Galaxies
We take it for granted that our universe contains planets, stars, and galaxies because those are the things we see. But the only reason these big structures exist is because of the nature of nothingness - empty space. But to understand why, we have to go…