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
Visit Her at Your Peril | Barkskins
[birds chirping] You are Mari, the housekeeper. He’s told me of you. [thud] Some creatures must go back to go wild, it seems. Monsieur Trepagny smashes them with his stick at night, and they know to stay away from our bed. He does have dominion over all. …
It’s Over: Why The Middle Class Is Financially Screwed
What’s up guys, it’s Graham here. So usually when I see a mistake or something that shouldn’t be happening, I like to call it out and share my thoughts because investing is something I take extremely seriously, and today is no exception. During a time whe…
10 Stoic Principles So That NOTHING Can AFFECT YOU | Epictetus (Stoicism)
[Music] In the chaos of our daily lives, it’s easy to feel like we’re drowning in a sea of stress and uncertainty. Yet, there’s a way to find calm amidst the storm—a path to inner peace that has stood the test of time. Imagine yourself standing firm, uns…
Subscriptions Are Scamming You
Subscriptions are everywhere: streaming services, software, groceries, even the heating in your car. Companies have convinced us that subscriptions will make our life easier, give us access to way more than we could afford if we had to pay out of pocket f…
How I built a $275 million biotech company from nothing
What I founded Envision, I just did not look like the typical biotech or healthcare founder. I’m a brown woman. I’m a woman of color, and I didn’t have any one of the many higher degrees that they like, you know, MBA, PhD, MD. So there I am with my little…
Flight at the Edge of the Ozone Layer | One Strange Rock
NARRATOR: 30 years ago, we discovered man-made chemicals had punched a hole in the ozone layer. Is that hole here to stay, waiting around to kill us? Today, we’re trying hard to find out. Morgan Sandercock is about to test an experimental plane, perfect f…