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
Volume of pyramids intuition | Solid geometry | High school geometry | Khan Academy
In this video, we’re going to talk about the volume of a pyramid. Many of you might already be familiar with the formula for the volume of a pyramid, but the goal of this video is to give us an intuition or to get us some arguments as to why that is the f…
Kevin O'Leary shares his thoughts on the market
You’re listening to the real estate talk show with Simon Janini and Erin McCoy on Talk Radio AM 640. Welcome back to the real estate talk show, your source for all things real estate. Now Simon, we know that for some, real estate is single-handedly the m…
1996 Berkshire Hathaway Annual Meeting (Full Version)
[Applause] Just a little early but I think, uh, everyone’s had a chance to take their seats. I must say this is the first time I’ve seen this program. They told me they’d surprise me and they certainly did. Mark Hamburg, our Chief Financial Officer, who i…
Diane Greene's Advice for Founders
Hi everyone! I guess I’m miked up. I can stand right here. Um, I’m just here to introduce our next speaker, who’s one of my just favorite people, Diane Green. She is, you all, I’m sure know her, so she needs no introduction. But she’s the chief of Google’…
Why Age? Should We End Aging Forever?
If you had to choose right now, how long would you want to live? 80 years? 90? 120? Longer? And do you think you’ll change your mind once you reach that age? Fifty thousand years ago, most humans died very young. As we learned how to use the resources ar…
The Water of Lost Hills | Water & Power: A California Heist
MARK: Rafaela, I know you feel grateful. Yes. To The Wonderful Company, and they have done things that no farmer will do. Yes. There’s a park now. There’s– Yes, I know. - The roads are better. There’s some houses. But the wages are still minimum. And t…