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
Jeremey Grantham: “A Storm Is Brewing” in the Global Real Estate Market
Real estate is a global bubble. It has driven house prices provably to multiples of family income all over the world. No one can afford to buy a house now. No young kids coming out can buy a house. House prices will come down everywhere. Jeremy Grantham …
It grows from the barrel of a gun
Chairman now said every communist must grasp the truth: political power grows out of the barrel of a gun. The power of the state is, of course, political, so Chairman Mao could have said that the power of the state grows out of the barrel of a gun. Is thi…
DoorDash at YC Summer 2013 Demo Day
Hi, we’re DoorDash, and we enable every restaurant to deliver for customers. We offer restaurant food delivery in under 45 minutes, and for restaurant owners, we provide our own drivers and manage the logistics of delivery. Now, you might think that food…
Graphing logarithmic functions (example 2) | Algebra 2 | Khan Academy
This is a screenshot from an exercise on Khan Academy. It says the interactive graph below contains the graph of y is equal to log base 2 of x as a dashed curve, and you can see it down there is that dashed curve with the points (1, 0) and (2, 1) highligh…
Natural, cyclical, structural, and frictional unemployment rates | AP Macroeconomics | Khan Academy
[Instructor] We’ve already discussed the notion of unemployment at length in other videos. And what we’re going to do in this video is dig a little bit deeper and think about what makes up the unemployment rate? And just as a review, the unemployment ra…
Why Youtube Feels Boring Now
Behind me are 100 people and they range from the age one all the way [Music]. This is Mummy Pig. YouTube feels boring now. Those were the exact words my friend said to me as we talked about the current state of the platform. I asked him why he felt so, a…