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
Peter Lynch: How to Invest Like a Pro (Most Recent Interview)
Now when somebody reports earnings, it’s telecast all over the world. They have an investor presentation; they show a balance sheet. So information is much better. So theoretically, the individual’s edge has improved in the last 23 years versus the profes…
Example finding distance with Pythagorean theorem
We are asked what is the distance between the following points, so pause this video and see if you can figure it out. Well, there are multiple ways to think about it. The way I think about it is really to try to draw a right triangle where these points, w…
PUT YOUR MONEY TO WORK | Meet Kevin PT II
You know, there’s a reason that after seven years, fifty percent of unions, uh, fall apart. It has nothing to do with infidelity; most marriages can survive that. But it has a lot to do with financial pressure. When we, when they bought a house, it was fo…
Michael Burry’s New Warning for the 2023 Recession
Michael Berry made his name betting against the housing market. It took two years for the drama to play out, but the subprime mortgage market finally collapsed in 2007, just as he had predicted. So, he made a ton of money, much more than I ever imagined I…
Matt Ridley: How Innovation Works, Part 1
I don’t have heroes; a hero’s a big word. There are people that I look up to, and I’ve learned a lot from, and Matt Ridley has got to be near the top of that list. Growing up, I was a voracious reader, especially reading science. Matt had a bigger influen…
Calculating t statistic for slope of regression line | AP Statistics | Khan Academy
[Instructor] Jian obtained a random sample of data on how long it took each of 24 students to complete a timed reaction game and a timed memory game. He noticed a positive linear relationship between the times on each task. Here is a computer output on th…