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
Porcelain in the Wreckage | Drain the Oceans
I grew up here in Portland. As a child, we all loved Indiana Jones. But it was actually really in high school when I was able to take an anthropology class, and it really piqued my interest. And then in community college, I started taking archeology class…
Estimating decimal addition (thousandths) | Adding decimals | Grade 5 (TX TEKS) | Khan Academy
So we have two questions here, but don’t stress out. Anytime I even see a lot of decimals, I’m like, okay, is this going to be a lot of hairy arithmetic? But what we see here, it does not say what 8.37 + 4926 is equal to. The equal sign is squiggly. That …
5 Things to Know About Fighting ISIS | Explorer
[Music] The Kurds are often described as the largest, the world’s largest ethnic group that does not have a country of its own. Most people put the population of Kurds at about 30 million, and they’re spread through at least four countries: Syria, Turkey,…
24 Hours of Sun at the South Pole | Continent 7: Antarctica
The sunlight down there is incredible because you get to see animals go about sort of what they do in perpetual sunlight. In 24 hours, generally, if you have nighttime, if we’ve got an instrument on an animal, or it gets dark out, you can’t work. For me,…
Researching Psilocybin's Effects on Depression - Dr. Rosalind Watts
How did this particular research project get started? This particular research started after various other studies looking into the effects of psilocybin on the brain and NST on the brain. This was the work of Robin Kaha Harris, whose interest came out of…
Boost writing skills with Khan Academy's new essay feedback feature
Hey there! If you’ve heard of Kigo KH Academy’s AI-powered tutor and teaching assistant, you probably know about how it’s been developed to help students solve math problems without giving away the answer, strengthen arguments through debate, or break dow…