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
Constructing linear and exponential functions from graph | Algebra II | Khan Academy
The graphs of the linear function ( f(x) = mx + b ) and the exponential function ( g(x) = a \cdot r^x ) where ( r > 0 ) pass through the points ((-1, 9)) and ((1, 1)). So this very clearly is the linear function; it is a line right over here, and this …
What language shows cause and effect? | Reading | Khan Academy
Hello readers! Once upon a time, in the previous century, there lived a cartoonist and engineer named Rube Goldberg, who became well known for his drawings of wacky, over-complicated machines. This is one such machine: the self-operating napkin. You see h…
Graphing a shifted and stretched absolute value function
So we’re asked to graph ( f(x) = 2 \times |x + 3| + 2 ). And what they’ve already graphed for us, this right over here, is the graph of ( y = |x| ). Let’s do this through a series of transformations. So the next thing I want to graph, let’s see if we ca…
2009 Berkshire Hathaway Annual Meeting (Full Version)
[Applause] Good morning! I’m Warren, the hyperkinetic fellow. Here is Charlie, and we’re going to go in just a minute to a question and answer section that, at least, a question session that will be a little different than last year. We have a panel, I ca…
Inequalities word problems | 6th grade | Khan Academy
We’re told that Eric is shorter than Preethi. Preethi is 158 centimeters tall. Write an inequality that compares Eric’s height in centimeters, E, to Preethi’s height. Pause this video and see if you can do that. All right, so we have Eric’s height, which…
Wolves vs. Bison: On Location | Hostile Planet
The stars of “Hostile Planet” are obviously the animals. But the unsung heroes are the crew that work so hard to bring you that footage. [wolves howling] PETE MCGOWAN: So my name’s Pete McGowan. I’m here in the Canadian Arctic, trying to film wolves hun…