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
What Could Survive An Atomic Bomb?
According to popular myth, cockroaches would inherit a post-nuclear disaster world. But it looks like the real winners might actually be fungi. In 1999, fungi were found to be thriving in highly radioactive conditions inside the Chernobyl reactor. These f…
Gordon Makes Smoked Fish Sausage | Gordon Ramsay: Uncharted
[Music] With one day until Chef James and I battle for the honor of being deemed Yupa, I’m off to meet a man who’s famous for three words you don’t normally hear together: smoked fish sausages. Now, sounds a bit mad, doesn’t it? Smoke fish sausage. But if…
Scouting for Wildlife in Big Bend National Park | National Geographic
So it looks like we got some animal activity already. Hold on. Don’t come down any further. We’re here at probably one of the most beautiful spots that you can see in Big Bend National Park, Santa Elena Canyon. I am scouting for National Geographic right …
15 Books That Will Change Your Perception of Reality
Last Saturday, we made a video on ways to become lifelong learners. And one way to achieve that is to have an annual reading list. The average American reads around 12 books a year. That’s one a month. We’ll give you 15 to start with for next year. Welco…
Predatory Shark Attacks | When Sharks Attack
When a shark bites a human, they never get the same taste, let’s say, as they would by biting a fish. So generally, they will release us and swim away. These incidents were totally different. The shark came in, attacked the victim, and came back and attac…
Expressing decimals in multiple forms
We’re asked which two of the following expressions have the same value as eight point seven six. Pause this video and see if you can figure this out on your own. Alright, now let’s do it together. Before I even look at these choices, I’m just going to re…