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
Aloneness vs. Loneliness | What's The Difference?
At the end of the day, loneliness is just a mindset. I won’t deny that it can be difficult to get rid of feelings of loneliness because the desire for companionship is deeply ingrained in human nature. However, this doesn’t mean that we have to suffer whe…
See Antarctica Like Never Before | National Geographic
[Music] I think there’s no place on earth like Antarctica. You can spend days and days and days here without seeing any other human being. It’s just as close as there is to being alone on this planet. It’s just so beautiful, so majestic, so overwhelming. …
Ask me anything with Sal Khan: May 15 | Homeroom with Sal
Hi everyone, welcome to the daily homeroom livestream. For those of you all who are wondering what this is, when we started having physical school closures, we realized—and everyone had to be socially distant—we realized that it’s our duty really, as a no…
Before Free Solo | Edge of the Unknown on Disney+
[SUSPENSEFUL MUSIC] MAN 1: Morocco, it’s off the map. No one would know about it. This was a place where he could test himself, both physically and mentally with a massive amount of climbing. And then, he wanted to free solo one of the big walls at the e…
Area of an isosceles triangle
Pause this video and see if you can find the area of this triangle. I’ll give you two hints: recognize this is an isosceles triangle, and another hint is that the Pythagorean theorem might be useful. All right, now let’s work through this together. So we…
The Benefits of Social Isolation
“There are days when solitude is heady wine that intoxicates you, others when it is a bitter tonic, and still others when it is a poison that makes you beat your head against the wall.” — Sidonie-Gabrielle Colette Imagine that you have to spend a long ti…