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
Identifying quadratic patterns | Polynomial factorization | Algebra 2 | Khan Academy
We’re told that we want to factor the following expression, and they ask us which pattern can we use to factor the expression. U and V are either constant integers or single variable expressions. So we’ll do this one together, and then we’ll have a few mo…
how to ACTUALLY CHANGE your life in 2023 (step by step guide)
We all experienced failure at some point in our lives. Maybe you didn’t get that promotion you were hoping for, or you didn’t accomplish a personal goal you set for yourself. But for some reason, when it gets closer to New Year’s, we tend to be more hopef…
The Second Great Awakening - part 1
The Second Great Awakening was one of the most important social, religious, and cultural aspects of the early 19th century in the United States. In fact, I might even make the argument that it’s impossible to understand the early 19th century without unde…
Changing Glaciers of Iceland | Explorers in the Field
(Slow piano music) I walk into a room and I tell someone I’m a glaciologist. Usually, someone looks at me and says, “Well, soon you’ll be a historian because the ice is going away.” We have the ability to turn this around, and I think we’re going to. We …
Caroline Hu Flexer: research shows Khan Academy Kids boosts pre-literacy skills | Homeroom with Sal
Hi everyone! Welcome to the daily homeroom live stream. I’m Sal Khan from Khan Academy. For those of y’all who are new to this, this is a homeroom that we are doing every day, as the name implies, to really stay connected during these times of school clos…
Everest Glaciology - Truth is in the Ice | National Geographic
The very idea that the highest part of the planet has been impacted by human activity ought to be a real wake-up call for everybody. We’re working close to the top of Everest. No other scientists work. The big goal of this National Geographic project is t…