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
Trying to Catch a 1,000 MPH Baseball - Smarter Every Day 247
Hey, it’s me Destin. Welcome back to “Smarter Every Day.” This video is awesome because we’re finally going to shoot it at stuff. And if you don’t know what I’m talking about, in a previous episode of “Smarter Every Day,” we fulfilled an important dream o…
Is It Possible to Run a Marathon in Under 2 Hours? | Breaking2
Ever since 490 BC, when Thea deputies ran the 26 miles from Marathon to Athens to declare victory over the Persians and promptly died, humans have been asking themselves, “How fast can we run this distance?” It’s a question that has motivated us for thou…
Homeroom With Sal - Is College Right for Me? (Part 2)
All right, well, I think we are back. So we had a little bit of technical difficulties as sometimes might happen on the internet. But Ernest, you were going through your explanation, and you were talking about how at Morehouse you were able to work with t…
Meet The Homeless Man Who Bought A Bugatti | TheStradman
[Applause] What’s up you guys? It’s Graham here! So a little over four years ago, right before I started making YouTube videos, I met James, also known as The Stradman, through a close friend of mine, Gordon, also known as F-Spot. We started talking cars;…
Fishing With Dynamite Is Harmful—Why Does It Persist? | National Geographic
[Music] You can come out here on a fine morning and you know there’ll just be ramp and blasting in areas where there may be tuna feeds, or if there aren’t tuna feeds, then they may target the reefs. I would say probably for the last 5 years it’s at least …
Article V of the Constitution | US government and civics | Khan Academy
Hey, this is Kim from Khan Academy, and today I’m learning about Article 5 of the U.S. Constitution, which describes the Constitution’s amendment process. To learn more about Article 5, I talked to two experts: Professor Michael Rappaport, who is the Darl…