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
You'll NEVER want to be SMART ever again: Schopenhauer's Secret
Ruling over others is an art, and many philosophers have offered different ways to master it. However, the German philosopher Arthur Schopenhauer suggested a unique approach: playing dumb. You can achieve success and be labeled as an arrogant person, but …
14 minutes of more useless information..
[Music] As I was getting ready to go out the other day, I realized I couldn’t button my pants up all the way. I realized I was gravitationally challenged and that I had been growing in all the wrong directions. So I started doing what any reasonable perso…
Biased and unbiased estimators from sampling distributions examples
Alejandro was curious if sample median was an unbiased estimator of population median. He placed ping-pong balls numbered from zero to 32 in a drum and mixed them well. Note that the median of the population is 16. He then took a random sample of five bal…
Buddha - Avoid Fools, Make Wise Friends
In /The Dhammapada/, Buddha says, “If, as you travel, you meet none better than yourself, or equal, you should steadfastly travel alone. There’s no companionship with fools.” So, Buddha’s saying that the fool doesn’t make a good friend, and if you don’t h…
15 Habits of Highly Organized Individuals
You know, Aluxer, life is like a puzzle full of colors. The pieces are chaotic, have irregular shapes, and are so colorful your brain hurts sometimes when you’re trying to put them all together. You might say it’s impossible to make this puzzle, but some …
3 year old reports on oil spill conditions on Alabama's Gulf coast
Hey, this is Sadie and daddy. Say hello, STI! Hello! And we are at the beach in Gulf Shores. What have we been doing this morning? We were playing. We’re going to the beach. Is there oil on the beach today? Did you see any oil? No, I didn’t either. What …