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
'This Is Karma, Ladies And Gentlemen!': Dana White Speaks During Trump Victory Celebration
We also have a Manda White who has done some job. He’s that tough guy. So Dana started UFC and, uh, came to me. Do you mind if I use your? Nobody wanted to give him a ring because they said it’s a rough sport—a little rough. I helped him out a little bit,…
Breaking down forces for free body diagrams | AP Physics 1 | Khan Academy
Let’s say we have some type of hard flat frictionless surface right over here. That’s my drawing of a hard flat frictionless surface. On that, I have a block, and that block is not accelerating in any direction; it is just sitting there. Let’s say we kno…
Anthony Mackie Descends a Cliff Face | Running Wild with Bear Grylls
[dramatic music] BEAR GRYLLS: Anthony Mackie and I are high in the Dolomite Mountains of Italy. Doing a great job, Anthony, well done. We’re using an old hemp rope, just like soldiers would use in World War I, to descend the sheer rock face. It’s about no…
The One Ring Explained
These books are all about this ring. How it’s found and [spoiler alert] how it’s destroyed. While Tolkien built the largest and most consistent fictional universe, he sure didn’t mind being vague at times. So, if you finished the story and then thought: w…
Why Does The Earth Spin?
So, I’m down in West Vancouver, British Columbia, which is where I grew up. At the local beach, there is this 2 and 1⁄2 ton granite sphere that was made to have a tolerance of 200s of a millimeter. This is an amazing granite sphere, and it’s floated on a …
How Many Countries Are There?
How many countries are there? Easy: just grab a map and start counting, yes? No. Not all maps are created equal – borders will differ depending on who you got the map from. So if individuals disagree, then surely a committee will save the day. Go to the U…