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
Charlie Munger: Be a Survivor, Not a Victim
Of course, feeling like it’s rather interesting to make change. Some people are victimized by other people, and if it weren’t for the indignation that that causes, we wouldn’t have the reforms that we need. But that truth is mixed with another. It’s very…
What Is Intelligence? Where Does it Begin?
Humans are proud of a lot of things, from particle accelerators to poetry to Pokemon. All of them made possible because of something humans value extremely highly: Intelligence. We think of intelligence as a trait like height or strength, but when we try …
The Biggest Watch Store in Las Vegas l Exclusive Tour
Hey, Mr. Wonderful here! How are you? We’re in a very special place. You know I love watches. We’re in Caesar’s Palace in Las Vegas at one of the world’s largest watch stores. I’m in Las Vegas; what do you expect? I’m going to do the Marilyn Monroe walk …
Richard Carranza on how NYC is handling school closures during Covid-19 | Homeroom with Sal
Hi everyone! Welcome to the daily homeroom live stream, which is something that all of us at Khan Academy started up once we started having mass school physical closures. I should say many seems like a lifetime ago. It’s just a way to keep in touch, have …
What is Khanmigo moderation? | Introducing Khanmigo | Khanmigo for students | Khan Academy
In this video, we’re going to see how Kigo can sometimes moderate the conversation in an attempt to protect you, the user. Sometimes it gets it right, but sometimes it gets it wrong. What do we do in those situations? So, let’s say we want to write a fan…
Divers Find a Wreck 90 Meters Down | Drain the Oceans
It is a very deep dive with a lot of repercussions that come up too fast. Bubbles would form inside your blood, inside your tissues, and cause ill effects. To get to 90 meters, you’d be looking at 4 or 5 minutes to get down there. It’s very dark because y…