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
Energy Conservation| Energy Resources and Consumption| AP Environmental Science| Khan Academy
In this video, we’re going to talk about energy conservation, or trying to save or lower the amount of energy that we use. Now, a lot of y’all might already have a sense that that is a good thing, while others of you might say, “Hey, why can’t I just use …
Evaluating exponent expressions with variables
We are asked to evaluate the expression (5) to the (x) power minus (3) to the (x) power for (x) equals (2). So pause this video and see if you can figure out what hap—what does this expression equal when (x) equals (2). All right, now let’s work through …
How to Keep Your Child Learning & Happy! at Home
Hello! Thank you for joining us today. We know how busy you are as parents of young children, particularly during these times with so much going on in the world. We want to make the session a really valuable use of your time, so we’re going to jump right …
Why I opened the first private jet showroom in the world!
The reason I built the first and only aviation showroom in the world is because nobody else has. I had to be different. Everybody in our industry today lives off a mobile phone and a laptop; that’s their business, that’s their office. To me, it just doesn…
Powers of zero | Exponents, radicals, and scientific notation | Pre-algebra | Khan Academy
In this video, we’re going to talk about powers of zero. Just as a little bit of a reminder, let’s start with a non-zero number just to remind ourselves what exponentiation is all about. So, if I were to take 2 to the first power, one way to think about …
Surviving an Alligator Attack | Something Bit Me!
Back in a Florida river, an alligator has Fred Langdale dead in its sights and is approaching quickly. So in that moment, I’m thinking, what can I do? What can I do? Some of this stuff I’ve already thought about ahead of time because I’m in the water all …