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
Galaxies and gravity | Earth in space | Middle school Earth and space science | Khan Academy
Hello everyone! Today we’re going to be talking about galaxies and gravity. We know the Earth is a planet that is in orbit around the Sun. This is called the heliocentric model, and the solar system is an enormous space for us, encompassing every place th…
Lao Tzu - The Art of Not Trying
This episode of after skool was written by Einzelgänger. Those who stand on tiptoes do not stand firmly; those who rush ahead don’t get very far; those who try to outshine others dim their own light. Taoists have long observed that humans often act in co…
Flow of energy and matter through ecosystems | High school biology | Khan Academy
Let’s think a little bit about how energy flows and how matter is recycled in an ecosystem. So, the whole time that we go through this video, think about these two ideas. And then, even after watching this video, look at ecosystems around yourself, even o…
What staying up all night does to your brain - Anna Rothschild
You’re just one Roman Empire history final away from a relaxing spring break. But you still have so much to study! So you decide to follow in the footsteps of many students before you and pull an all-nighter. When you stay up all night, you’re fighting a…
What Reagan policies are still debated today? | US Government and Civics | Khan Academy
How has the debate over Reagan’s policies evolved into today? When Reagan was making the case, they called it the Reagan Revolution because it was a real departure from the way the federal government had been existing in American life. The debate had most…
Suhail Doshi - How to Measure Your Product
We are very grateful to have Suhail from Mixpanel, who co-founded Mixpanel almost 10 years ago now and is going to talk about how to measure your product, which, as you heard from Gustav, is really the other side of the coin of growth and everything that …