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
Pick a Business Model With Leverage
One more question about leverage. Do you think a choice of business model or a choice of product can also bring a kind of leverage to it? For example, pursuing a business that has network effects, pursuing a business that has brand effects, or other choic…
Representing endothermic and exothermic processes using energy diagrams | Khan Academy
Let’s say we run an experiment to determine if a reaction is endo or exothermic. For our hypothetical reaction, A reacts with B to form C, and let’s say this reaction takes place in aqueous solution in a beaker. We can define our system as the reactants a…
Warren Buffett Just Made a Huge Bet on a Hidden Stock.
Warren Buffett has very sneakily just made a rather sizable bet on a new stock, and it’s not your typical Buffett-style investment, like what he did last year with Activision Blizzard stock. Buffett has just placed another big Arbitrage bet that a certain…
My Life Advice for People in their 30s
This is about advice for people in their 30s. You know, every stage of life has different things that are important, and then how you approach them at that stage of life is important. The 30s is, hey, now it’s getting serious. Okay, you know, uh, you went…
Fourier series coefficients for cosine terms
So we’ve been spending some time now thinking about the idea of a Fourier series, taking a periodic function and representing it as the sum of weighted cosines and sines. Some of you might say, “Well, how is this constant weighted cosine or sine?” Well, y…
Residual plots | Exploring bivariate numerical data | AP Statistics | Khan Academy
What we’re going to do in this video is talk about the idea of a residual plot for a given regression and the data that it’s trying to explain. So right over here we have a fairly simple least squares regression. We’re trying to fit four points. In previ…