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
Don't Suffer More Than Needed | Buddhist Philosophy on Pain and Suffering
When we think of pain and suffering, we usually think about more or less the same thing. When there’s pain, there’s suffering. And we can only be free from suffering if we eliminate pain, right? Well, even though these two experiences are interconnected,…
See How Life Has Changed in the Middle East Over 58 Years | Short Film Showcase
That’s right across the Lebanese Syrian border. I stopped, pulled out my camera because I had resolved that the entire time I was in the Middle East, that I was going to keep a detailed photographic record of all my landscapes and have a real collection o…
Collecting Ice for Cocktails | Restaurants at the End of the World | National Geographic
Oh my God! So what are we getting? We’re getting ice. We’re getting…the most obvious choice. Kill the engine, brother. If you’re really quiet, and you listen through the waves, you hear all the pops and cracks? Mm hmm. This is the glacier ice expansion, …
Why Life Seems to Speed Up as We Age
I remember when I was a kid waiting an hour for my favorite TV show to come on, which was Sharon, Lois & Bram. That felt like eternity, but as I’ve gotten older, everything seems to have sped up. Time is going much faster. That’s something virtually e…
What are affixes? | Reading | Khan Academy
Hello readers! Today we’re going to talk about things called affixes. One of the things that I love about the English language is how flexible its words can be. You can take little word parts and stick them together to make new words. If I read something…
Taking a break from stocks
What’s up, Graham? It’s guys here. So, I think it’s really important that we talk about a concerning new trend that’s just started to surface in the stock market over the last few weeks. And listen, I get it. These last few months have been rather eventf…