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
Coordinate plane relationships
We’re told Jazella plots the ordered pair (4, 3) on a coordinate grid by moving four units to the right and three units down from the origin. Which statement is true? So pause this video and have a go at this before we do this together. All right, now be…
Introduction to the cell | Cells | High school biology | Khan Academy
You might already have some type of a notion of what a cell is. You might already realize that it is the most basic unit of life. Some would argue that maybe viruses are even a more basic unit of life. But the organisms that we consider living, like ourse…
Will This Go Faster Than Light?
The speed of light is meant to be the ultimate speed limit in the universe. According to Einstein’s special theory of relativity, nothing should move through space faster than light. But that doesn’t stop people from trying. Every day I get a lot of mess…
Design for Startups by Garry Tan (Part 2)
Now’s the super practical section of how to find and choose designers. We can get through this really quickly. Happy to answer questions afterwards about it, but you know the basic questions we always get asked is, you know, well when, when and how. The r…
Inside Jason Oppenheim's $10,000,000 Custom Hollywood Home
What’s up guys! It’s Graham here, so today I’m gonna be touring Jason Oppenheim’s snootily finished ten million dollar house here in the Hollywood Hills. I gotta say, this one has some of the most outrageous high-quality, just extravagant finishes, furnit…
The Rules for Rulers
[Ominous music plays] Do you want to rule? Do you see the problems in your country and know how to fix them? If only you had the power to do so. Well, you’ve come to the right place. But before we begin this lesson in political power, ask yourself: why d…