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
Supreme Court Shenanigans !!!
In the United States, the Supreme Court is the highest court, given the final say on what laws really mean, and if they’re cool with the Constitution. Well, this power was not given given, but taken. Back in the day, the Supreme Court ruled it is the duty…
LA92 Panel - Live | National Geographic
[Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Laughter] [Music] [Laughter] [Music] [Laughter] [Music] [Laughter] [Music] [Laughter] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] you you [Music] you [Mus…
The Constant Fear of Driving While Black | National Geographic
I have this a lot of police of about four times in the last sixty days. A total of five times I’ve been probably more than 20 times. It’s more times than I care to remember. But what you do know is how a very familiar feeling comes each time I’m stopped. …
Climate 101: Ozone Depletion | National Geographic
(upbeat piano music) [Narrator] 15 to 35 kilometers above Earth’s surface, a gas called ozone surrounds the planet. The ozone layer acts as a barrier between Earth and ultraviolet radiation from the Sun. However, pollution has caused the ozone layer to t…
Worked example: Rewriting definite integral as limit of Riemann sum | AP Calculus AB | Khan Academy
Let’s get some practice rewriting definite integrals as the limit of a Riemann sum. So let’s say I wanted to take the definite integral from π to 2π of cosine of x dx. What I want to do is write it as the limit as n approaches infinity of a Riemann sum. …
Shower Thoughts: Space Is Weird
The universe is a mind-boggling place. Actually, I’m not even sure I can call it a place. NASA says the universe is everything, but what they really mean is that it contains everything— all of space, energy, time, and matter, like you and me. But there’s …