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
Khan Stories: Claudia
My name’s Claudia and I’m currently a freshman at MIT. I’m from South Florida and now my journey continues here. My family is from the Azores Islands, which are in the middle of the Atlantic. Just knowing that where my family comes from and the lack of e…
What's Driving Shark Attacks in Recife? | SharkFest
[dramatic music] NARRATOR: Along a roughly 25-mile stretch of shore, there have been more than 60 shark attacks since records began and almost half of them fatal. In fact, this small area accounts for almost 50% of recorded attacks in the entire continen…
Does Your Startup Need To Be In San Francisco?
We’re working together. We’re in the same room right now. Yes, we get to live in the same area, even though our personal decisions about where we live are wildly different. Yeah, very different lives. I don’t have a yard. I have kids too. [Music] All ri…
Khan Stories: Shrey
It was amazing! I don’t think I’ll ever forget in my life. “Mom, I made it to Harvard!” I mean, it was like a Bollywood Hollywood kind of a sentence. I’m Srey. Um, I’m a freshman at Harvard, class of 2022, and I’m from New Delhi, India. I’ve been using …
Why Letting Go Is True Wealth | Minimalist Philosophy for Simple Living
One day, the legendary Chinese recluse Xu You watched a mole drinking water from a pond. He then realized that the mole, when thirsty, only drinks a bellyful: no more, no less, but exactly the quantity it needs. The mole doesn’t encumber itself with exces…
The Beginner's Guide To Stoic Travel
When studying the ancient scriptures, we discover a love-hate relationship between the Stoics and travel. So, is there a Stoic way to travel? And how can Stoicism benefit those who engage in traveling? In this video, I want to present you the beginner’s g…