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
Are We Running Out of Sand?
[Music] It can be easy to take something for granted that every time you see it, it seems to go on forever. It’s like an infinite path to the horizon, a landscape that never ends. This is sand. And even though just a simple trip to the beach can make it f…
Computing a Jacobian matrix
So just as a reminder of where we are, we’ve got this very nonlinear transformation. We showed that if you zoom in on a specific point while that transformation is happening, it looks a lot like something linear. We reasoned that you can figure out what l…
Renewable Energy For the People | From the Ashes
Here we are in one of the reddest cities and one of the reddest counties in one of the reddest states. But we put the silly national politics aside to do what’s best for the people we were elected to serve. The best thing to do was to sign contracts for …
THE FED JUST FLIPPED THE MARKET | Urgent Changes Explained
What’s up, Graham? It’s guys here! So, you know the saying that riches are made in recessions? Well, even though housing data fell to its lowest level ever, tech layoffs are getting more and more common, and the price for oil keeps going higher. Brand ne…
15 Reasons Why People Look Down On You
Humans are judgmental. And while most people won’t outright insult someone, our minds still form very quick, firm opinions about people. If you think someone looks down on you, well, honestly, they actually might. If something feels off with the way they …
The Next Housing Market Crash (Worse Than 2008)
What’s up, Graham? It’s Guys here, and 2023 is already shaping up to be an absolute mess. Thieves have reportedly stolen 2 million dimes from the back of a van in Philadelphia. A teenager was banned for climbing into and getting stuck in a claw machine. H…