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
Theories Are Explanations, Not Predictions
There’s another example from science like this. On a heat source, put a beaker of water, then put a thermometer into that water and turn on your heat source. Then record, as the time passes, what the temperature of the water is. You will notice that the t…
How To Cure "Brain Fog" | 3 Tips for Mental Clarity
[Music] You know someone who wants to taper off caffeine? I’m not doing a very good job; having an espresso machine right next to my desk is very dangerous and probably a stupid idea. So, you know, it’s pretty crazy. The human brain is pretty crazy; it’s…
The Gettysburg Address - part 1
All right, so we left off with the Battle of Gettysburg from July 1st to 3rd, 1863. As I mentioned in the last video, Gettysburg was a really significant battle in the Civil War. It was a real turning point for the Civil War, at which Lee brought the forc…
Do You Know Yourself? - Mind Field (Ep 8)
[soft dramatic music] - Hi, I’m Michael Stevens, but who are you? Do you even know who you are? Are you your memories? - I don’t remember that. - I don’t remember that at all. - Are you the choices you make? The focus tester is actually a magician. - That…
Fighting Fish on the Stand Up Rod | Wicked Tuna | National Geographic
Well, here we are. Sounds like the whole rest of the fleet went down south to Chatham. We’re sticking close to home though. We started using the stand up rod last year, and it’s been pretty lucky for us. It’s a bit different than fighting a Bluefin with o…
RECESSION ALERT: The 5 BEST Index Funds To Buy ASAP
What’s up, Graham? It’s guys here. So, I’ve noticed that people love to over complicate investing. Just buy into money puts expiring on May 12th over here, March in your portfolio. When the Fibonacci sequence falls below the 369-day moving average, you’ll…