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
Beautiful “Underwater Kaleidoscope” | National Geographic
I was inspired to be an ocean explorer from a very young age. We had a swimming pool in my backyard, and I would put on a little mask and fins and pretend I was Jacques Cousteau or I was swimming with sharks or dolphins or something. I had somewhat of an …
A method for sticking to habits
So it’s that time of year again. Everybody’s talking about all these crazy new habits they’re gonna start implementing in 2020 because in 2019 you weren’t living your real life. In 2020 though, that’s gonna be the real you. That’s gonna be the fully torqu…
_-substitution: defining _ | AP Calculus AB | Khan Academy
What we’re going to do in this video is give ourselves some practice in the first step of u substitution, which is often the most difficult for those who are first learning it. That’s recognizing when u substitution is appropriate and then defining an app…
Howard Marks: A Storm is Brewing in the Stock Market (The "AI Bubble")
Every bubble ensues from widespread conviction. People are now convinced AI will change the world. I imagine it will, but you know, if you go back 25 years ago, exactly to, uh, to mid-1999, everybody was sure that the internet would change the world. And …
15 Ways to Get Your Act Together For a New Chapter
7 years from now, it’s going to be 2031, almost 2032. And if you’re coming from the future, hello! Nice to have you here. But for now though, when this video is being made, it’s 2024, and you’re either in the middle of your long-term goals, at the end of …
Rare Footage: Wild Elephants “Mourn” Their Dead | National Geographic
I was pretty amazed by this scene when we came across it. You know, you do hear these stories about elephants showing this really keen interest in dead bodies of their species, and it’s just a very hard thing to observe. So, to find a body to begin with i…