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
Ask me anything with Sal Khan: May 8 | Homeroom with Sal
Hey everyone, Sal Khan here from Khan Academy. Welcome to our daily homeroom live stream. If it’s your first time and are wondering what is this? This is a live stream that we started doing every day since school closure started happening ‘cause we realiz…
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. …
ATP synthase | Cellular energetics | AP Biology | Khan Academy
In this video, we’re going to talk about what is arguably my favorite enzyme, and that is ATP synthase. You might be able to predict from its name what it does: it synthesizes ATP. Now, you’ve probably seen it before. We saw it when we looked at respirat…
Beaker Ball Balance Problem
Here is the set up. I have a balance and two identical beakers, which I fill with exactly the same amount of water, except in one of the beakers there is a submerged ping pong ball tethered to the base of the beaker. And in the other there is an identical…
Huge Announcements!
Well team, here we go! Oh, I get to make a huge announcement today, something that I’ve been working on for a very long time. Now I can’t, I actually can’t believe that I’m actually announcing this finally. It’s been months and months and months of work, …
Example: Analyzing the difference in distributions | Random variables | AP Statistics | Khan Academy
Suppose that men have a mean height of 178 centimeters, with a standard deviation of 8 centimeters. Women have a mean height of 170 centimeters, with a standard deviation of 6 centimeters. The male and female heights are each normally distributed. We inde…