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
BIGGEST Game Collection Ever... and More! -- Mind Blow 5
Yeah, let me get a beer. And how are you feeling that from the bottom? Are you some kind of evil wizard? I’m not drinking your evil wizard. But I forget it, just give me two. Speaking of wizards, let’s see what a little hydrogen peroxide and dry yeast ca…
One Good Tuna Deserves Another | Wicked Tuna
Get this guy over there! It’s pitch black. We got our anchor line out and so to a bunch of other boats around us. We got to make sure that our fish doesn’t come in contact with any of the other anchor lines in the water or it will be a huge paycheck. This…
Sources of loans/credit | Loans and debt | Financial Literacy | Khan Academy
So let’s talk a little bit about credit and lending. When I talk about credit, I’m literally just talking about someone’s willingness to lend you money or to actually lend you money. You’ve heard of a credit card; when you buy something with a credit card…
How Millionaires Think About Business | ft. Randall Kaplan
Kevin: “How good is this flavor?” I said, “It’s fantastic! I worked with the cats; I know they love it.” He said, “No, you’re gonna eat some right now. Prove it!” He made me eat the whole tin in front of the entire sales group. I want to talk about you…
Woman Struck by Meteorite | Smarter Every Day 84
Hey, it’s me, Destin. Welcome back to Smarter Every Day! So, you probably didn’t know that Alabama has its own Museum of Natural History. We also have the only meteorite to ever strike a human being. You want to check it out? It’s known as the Hodes meteo…
Hated, Ignored, Rejected & Happy: A Video for Outcasts (based on Black Mirror’s ‘Nosedive’)
Do we need a good reputation to be happy? The Black Mirror episode ‘Nosedive’ takes place in a futuristic world in which reputation is the main currency. The story revolves around a young woman named Lacie who desperately wants to raise her social credibi…