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
Impact of changes to trophic pyramids | High school biology | Khan Academy
What we see here is known as a trophic pyramid, and the word “trophic” in a biology context is referring to food relationships. So, one way to think about this is that it tells us who is eating whom and who is producing energy, and then who is able to lev…
Coupled reactions | Applications of thermodynamics | AP Chemistry | Khan Academy
Coupled reactions use a thermodynamically favorable reaction to drive a thermodynamically unfavorable reaction. For example, let’s look at a hypothetical reaction where reactants A and B combine to form products C and I. The standard change in free energy…
Beta decay | Physics | Khan Academy
Did you know that paper industries can use radioactivity to ensure consistent thickness throughout the paper? That’s right! But doesn’t it make you wonder how do you use radioactivity to do that? Well, let’s find out. If you have a very heavy nucleus, th…
How Much Money is LOVE Worth?
Hey, Vsauce. Michael here. And I’m in Los Angeles, but today we’re going to talk about love. You can’t buy love, but what if you could? I mean, what if I had a machine that could make you fall in love with someone for the rest of your life? What should I…
This Is Why Discord Is Dangerous
On the 13th of April 2023, a 21 year old member of the U.S Air Force National Guard, Jack Tashira, was arrested on live TV for leaking classified documents. Tashira had shared classified information about the war in Ukraine with his Discord group, Thug Sh…
How to Stick To Your Goals - A Quick Guide
[Music] Hey, what’s up? Imagine you’re a farmer and you’re really, really excited about planting a new carrot garden. You picture this in your mind: a field full of juicy carrots. You can give all these carrots to your friends. You want to be known as th…