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
Causes and Effects of Climate Change | National Geographic
Human activities, from pollution to overpopulation, are driving up the Earth’s temperature and fundamentally changing the world around us. The main cause is a phenomenon known as the greenhouse effect. Gases in the atmosphere, such as water vapor, carbon…
From $100 to $75 Million: Is Bitcoin a good investment?
What’s up you guys, it’s Graham here. So, if you’ve looked at the internet in the last few days, I’m sure you’ve seen an article out there that says if you had bought $100 of Bitcoin 7 years ago, you would have over $75 million today. Bitcoin is a topic t…
Shouldn't We Just Copy Warren Buffett's Portfolio?
I could not come up with these ideas on my own. I came up with this idea from Warren and Charlie, and I copied it. So, one of the most important models that you can adopt is the model of cloning. When you see someone doing something smart, uh, just incorp…
Warren Buffett's Secret Investing Checklist | The Warren Buffett Way Summary
The Warren Buffett Way is one of my favorite investing books of all time. It clearly lays out the framework Warren Buffett uses to pick winning stocks. The good news is that you can apply these lessons to your own investing strategy today. This book truly…
Politics in the Animal Kingdom: Single Transferable Vote
Queen Lion is looking to make the elections in her animal kingdom more fair. Currently, she divides her citizens into ranges, each of which selects one representative to go to the jungle council, which makes laws for the kingdom. But her citizens are unha…
Passing Along My Investment and Economic Principles
I think you might know that at my stage in life, uh, my main objective is to pass along what I have that’s valuable to others. That includes, most importantly, I think, the skills and the principles that, uh, helped me be successful in the areas that I ha…