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
Volume with cross sections: intro | Applications of integration | AP Calculus AB | Khan Academy
You are likely already familiar with finding the area between curves, and in fact, if you’re not, I encourage you to review that on Khan Academy. For example, we could find this yellow area using a definite integral. But what we’re going to do in this vi…
Theorem for limits of composite functions | Limits and contiuity | AP Calculus | Khan Academy
In this video, we’re going to try to understand limits of composite functions, or at least a way of thinking about limits of composite functions. In particular, we’re going to think about the case where we’re trying to find the limit as x approaches a of …
Heating curve for water | Thermodynamics | AP Chemistry | Khan Academy
Let’s look at the heating curve for water. A heating curve has temperature on the y-axis, in this case, we have it in degrees Celsius, and heat added on the x-axis; let’s say it’s in kilojoules. Let’s say we have 18.0 grams of ice, and our goal is to cal…
Adding and subtracting polynomials of degree two | Algebra 1 (TX TEKS) | Khan Academy
So we have two different expressions here, and what I want you to do is pause this video and see if you can rewrite each of these as a simplified polynomial in standard form. So pause the video and have a go with that. All right, now let’s do this togeth…
Worked example: Lewis diagram of xenon difluoride (XeF₂) | AP Chemistry | Khan Academy
Let’s do one more example of constructing a Lewis diagram that might be a little bit interesting. So let’s say we want to construct the Lewis structure or Lewis diagram for xenon difluoride. So pause this video and have a go at that. All right, now let’s…
15 Ways Rich People AVOID Paying Taxes
You know Albert Einstein? He said, “At best, the hardest thing in the world to understand is the income tax.” The rich have very expensive accounting experts that help them minimize just how much money they pay in taxes. In the last decade, we’ve learned…