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
Buddha - Be Aware, Become Free
In The Dhammapada, Buddha says, “the monk who delights in awareness, seeing the danger in unawareness, not liable to fall back, is close to [Nirvana].” So Buddha is saying that awareness leads to freedom from suffering, and unawareness leads to suffering.…
How Does The James Webb Space Telescope Work? - Smarter Every Day 262
This is my dad, and he’s about to finish this major job you’ve been working on, which is the James Webb Space Telescope? Sun shield for the James Webb Space Telescope. Hey, it’s me, Destin, welcome back to Smarter Every Day. The James Webb Space Telescope…
Electric forces | Forces at a distance | Middle school physics | Khan Academy
Have you ever taken a shirt out of a dryer and found a sock stuck to it? If you have, you might have noticed that once you pull the sock off, it was still attracted to the shirt, even when they weren’t touching. What is even happening here? Well, it turns…
Most Important Financial Decisions You Will Make In Your Life (Ranked)
We are the outcome of our choices. One day, you’ll look back on your life, and you’ll realize it’s the decisions you’ve made up until now that made you rich or poor. So, here are the most important financial decisions you will make in your life. Welcome …
Time Management for Teachers
Many teachers have a poor work-life balance. I know, because I’ve had years of experience as a teacher in the classroom. I’m here to teach you how to handle your workload and restore that work-life balance. If you follow my time management methods, long d…
Changing Glaciers of Iceland | Explorers in the Field
(Slow piano music) I walk into a room and I tell someone I’m a glaciologist. Usually, someone looks at me and says, “Well, soon you’ll be a historian because the ice is going away.” We have the ability to turn this around, and I think we’re going to. We …