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
15 Secrets Only Billionaires Know
As of 2023, there are 3,112 billionaires in the world. The billionaire perspective on life is quite different from anything you’ve ever experienced, and it’ll definitely go against many of the things you believe. Here are 15 secrets only billionaires know…
Smoking is Awesome
The problem with smoking is that it’s kind of amazing – this is an irresponsible thing to say – but if we’re going to talk about it, we might as well do so honestly. Smoking creates a temporary problem and offers an instant solution. Once your brain is us…
Drugs for a Fine (Clip) | To Catch a Smuggler | National Geographic
You said this was what, again? Okay, just give me a second to positive for ketamine hydrochloride, which is a DEA controlled substance. It’s illegal to transport into the U.S. It’s illegal to have in the U.S. without a prescription. I honestly didn’t kno…
General multiplication rule example: dependent events | Probability & combinatorics
We’re told that Maya and Doug are finalists in a crafting competition. For the final round, each of them will randomly select a card without replacement that will reveal what the star material must be in their craft. Here are the available cards. I guess …
Hedonism: The Pursuit of Happiness
In 2012, Drake made a song titled “The Motto,” but what most people remember from it is “YOLO.” YOLO tells you to live in the moment, enjoy life you have today, and not worry too much about tomorrow, because at the end of the day, you only live once. Whil…
Overview of ancient Greece | World History | Khan Academy
I am now going to give an overview of ancient Greece. In future videos, we’re going to go into a lot more depth on a lot of these events and ideas, but this one is to give you context on the big picture. Just to start, let’s begin with the name Greece. I…