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
Pink Dolphins Are Real—and Disappearing From Hong Kong | National Geographic
[Music] Well, the Chinese white dolphin is a long-term uh resident of Hong Kong waters, so it’s part of our natural heritage. They are quite symbolic in our marine environment because, you know, they’re very charismatic, and a lot of people love their app…
Peter Lynch’s Warning for the 2023 Recession
All right, I’m Becky Quick. I’m Andrew Sorkin. We’re going to Legendary investor Peter Lynch. He’s with us. Oh my God, oh my God, oh my God. Okay, it’s happening! Everybody stay calm! What’s your procedure? [Applause] By what you know is what Peter taug…
Best Spot in the Microwave? - Smarter Every Day 6
[Music] Okay, it’s me, Destin. I am here with Mike Simons at the National Electronics Museum, and he’s going to show us something that we interact with every day that you probably didn’t know. So, what do you got for us, Mike? (Mike) We have a microwav…
Eat the Top 15 Most Mind-Blowing Sushi with Lucas Sin in Tokyo's Best Omakase | Best of the World
Lucas: It’s like a sunset. Of tuna. The producers told me that I was going to be interacting and eating sushi in some way. The rarity, the specialness of the experience was not conveyed and could not have been conveyed. Here we are in Tokyo. Just got off…
Marginal benefit AP free response question | APⓇ Microeconomics | Khan Academy
We’re told Martha has a fixed budget of twenty dollars, and she spends it all on two goods: good X and good Y. The price of X is four dollars per unit, and the price of Y is two dollars per unit. The table below shows a total benefit measured in dollars M…
Living Off the Land in Hawaii | Explorer
People in developed countries often take it for granted that they can eat whatever delicacy they want from anywhere in the world. But there are some who fear that this globalization of food is putting all of us at risk, and they are now going back to livi…