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
Stratospheric Ozone Depletion| Global change| AP Environmental Science| Khan Academy
In this video, we’re going to talk about a molecule known as ozone. Ozone you can also view as O3 or three oxygens bonded this way. These dashed lines show that sometimes the double bond is on this side, sometimes it’s on that side. You might recognize th…
Exclamations | Syntax | Khan Academy
Paige, what I think we left something out of the last video. Oh no, I left exclamations after the last video! That’s not good. Okay, we can fix this. Okay, we just need to make a video. Yes! Oh hello, grammarians! Hello Paige! Hi David! So I want to talk…
Worked example: p-series | Series | AP Calculus BC | Khan Academy
So we have an infinite series here: one plus one over two to the fifth plus one over three to the fifth, and we just keep on going forever. We could write this as the sum from n equals one to infinity of 1 over n to the 5th power, 1 over n to the 5th powe…
Ballet Shoes: The Craft Before the Dance | Short Film Showcase
My name’s Tony Collins of Jim to free data. As a young lad, I arrived on the end of ‘69, 1969. I’ve been here ever since and out the lot of it at the old school from where we originated from Leicester Square. This is about three of us left in the firm sti…
Explaining the “Eureka Effect” | StarTalk
No one can imagine anybody else playing that role but you. So what were you doing? What’s your secret? Come on! I love the whole concept of scientists who deal with, uh, insoluble, uh, problems. I love the story of a noted scientist who was trying to fin…
Average velocity and speed worked example | One-dimensional motion | AP Physics 1 | Khan Academy
We are told a pig runs rightward 20 meters to eat a juicy apple. It then walks leftward 5 meters to eat a nut. Finally, it walks leftward another 25 meters to eat another nut. The total time taken by the pig was 300 seconds. What was the pig’s average vel…