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
Why Millennials Don’t Make Enough Money
What’s up you guys? It’s Graham here. So this has been a really good week. I’ve had the chance to cover my two favorite topics on the history of the universe. One would be Robin Hood’s investing platform, and number two, as you could see from the title of…
Creativity break: how can students expand their creativity in biology? | Khan Academy
[Music] I’d encourage every single one of you to spend some time immersed in a different culture or maybe even spend some time working in a totally different part of the world from where you grew up. Now, it doesn’t have to be quite that drastic; it coul…
How your brain is working against you
Whether you’ve been aware of it or not, your brain has been telling you a story about your own life. It’s been telling you a story about who you are, what your personality is like, what your strengths and weaknesses are, how likely you are to stick to cer…
Terlingua's Turning Point | Badlands, Texas
About 1881, Sierra Blanca was where the major railroads met and fought. There’s only one route to get from the rest of Texas to El Paso, so Texas Pacific raced through the Southern Pacific. Whoever got through the pass first would control the route to Cal…
My Video Went Viral. Here's Why
Now, you may have seen this thumbnail on YouTube. I mean, I can actually basically guarantee that YouTube has been shoving this in your face like, “Click! Click! Click it again!” So you might be wondering why. Why did this video in particular go viral? We…
The Role of Role Models | StarTalk
[Music] It’s often said that it’s easier to be something if you can see it; if you can imagine yourself in that position. Role models have always played an important role in that. Role models have that role. I have a slightly contrarian view of role mode…