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
Bivariate relationship linearity, strength and direction | AP Statistics | Khan Academy
What we have here is six different scatter plots that show the relationship between different variables. So for example, in this one here, in the horizontal axis, we might have something like age, and then here could be accident frequency. Accident frequ…
Impact of mass on orbital speed | AP Physics 1 | Khan Academy
A satellite of mass lowercase m orbits Earth at a radius capital R and speed v naught, as shown below. So, this has mass lowercase m. An aerospace engineer decides to launch a second satellite that is double the mass into the same orbit. So, the same orbi…
Dilution | Intermolecular forces and properties | AP Chemistry | Khan Academy
In this video, we’re going to talk about a concept in chemistry that’s quite important, known as dilutions. So let’s do an example. Let’s say we have a large vat, as much as we need. It’s a one molar solution of sodium sulfate, and it’s an aqueous soluti…
Face-to-Face with a Bear - Meet the Expert | National Geographic
Welcome! It is so lovely to see you all here today. I’m your host, Lizzy Daly, and I am thrilled to be bringing you all on an epic journey to meet some of the world’s best scientists, wildlife experts, and National Geographic explorers from around the wor…
There's no such thing as Universally Preferable Behaviour
Universally preferable behavior is the name of Stefan Malan’s book arguing for an objective non-religious foundation for morality. Uh, I’ll begin by saying I don’t believe that anything that could fairly be called objective morality exists. Uh, so catego…
MONACO'S BILLIONAIRES SECRETS EXPOSED!
Narrator: A tiny country smaller than Central Park that holds more billionaires per square mile than anywhere else on Earth, but today we’re not just talking about any billionaires; we’re going deeper into a world so exclusive that even money alone can’t …