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
_-substitution: definite integrals | AP Calculus AB | Khan Academy
What we’re going to do in this video is get some practice applying u-substitution to definite integrals. So let’s say we have the integral. So we’re going to go from x equals 1 to x equals 2, and the integral is (2x \times (x^2 + 1)^3 \, dx). So, I alrea…
Slow Motion Raptor Strikes - Smarter Every Day 38
Raptor training? That sounds interesting. Hey, it’s me Destin. I’m at Auburn University today at the Southeastern Raptor Centre with Andrew, and Andrew’s a pretty unique guy. What do you do, Andrew? -I get to work with birds every day. Every single day.…
How to Become Pope
Let’s say you want to become pope, head of the Catholic Church and shepherd to over 1 billion faithful. What requirements must you have for this lofty position? 1) Be a Catholic and 2) Be a man. Which seems a little thin… and, while it’s technically possi…
How Do Cartels Get Their Weapons? | Trafficked with Mariana van Zeller
[engine revving] [suspenseful music] MARIANA VAN ZELLER: In my quest to expose how American guns are trafficked throughout Mexico, I never expected to be headed out to sea. But as we move deeper into the waters, these smugglers break down their operation…
Why Patience is Power | Priceless Benefits of Being Patient
Buddha and his disciples once embarked on a long journey. Exhausted from a long day of walking, they decided to stop and rest near a lake. Buddha asked his youngest and most impatient disciple to walk to the lake and bring him some water, so he did. But w…
Motion along a curve: finding rate of change | Advanced derivatives | AP Calculus BC | Khan Academy
We’re told that a particle moves along the curve (x^2 y^2 = 16), so that the x-coordinate is changing at a constant rate of -2 units per minute. What is the rate of change, in units per minute, of the particle’s y-coordinate when the particle is at the po…