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
Lecture 9 - How to Raise Money (Marc Andreessen, Ron Conway, Parker Conrad)
Um, but I want to start with a question for Mark and Ron, which is by far the number one question. Probably be a link answer: what do you guys decide to invest in—a founder or a company? Neither of you: no, no, no, no, you first. Um, well, we have a sli…
Inside Japan’s Earthquake Simulator
This is the world’s largest earthquake simulator. It’s called E-Defense. Its huge shake table can support a 10-story building and then move it in all directions with the force of the world’s most destructive earthquakes. E-Defense has conducted more than …
Can causality be established from this study? | Study design | AP Statistics | Khan Academy
A gym that specializes in weight loss offers its members an optional dietary program for an extra fee. To study the effectiveness of the dietary program, a manager at the gym takes a random sample of 50 members who participate in the dietary program and 5…
Virtually Viral | Explorers in the Field
(Gentle music) [Pardis] Early on when my research wasn’t going that well, and I was having trouble, people would be like, well, she’s in a band. But then when my research started going well, and I started publishing, they’d be like wow, and she’s in a ba…
Nate Blecharczyk at Startup School 2013
[Applause] Wow, there are a lot of you! That’s awesome to see. You know, I got some emails over the last 24 hours from people saying how excited they were to come to this talk. I want you to know I’m humbled by that, and, uh, also a little intimidated. I …
Understand Where YOU are in the Life Cycle
There’s a life cycle of an individual, so I want to just touch on that for a bit. To me, the life cycle of a typical individual looks like this: In the first phase, you learn, and you’re dependent on others who guide you, most importantly your parents an…