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
You Swallowed a Tapeworm – What Now? #kurzgesagt #shorts
BL, you swallowed a tapeworm by accident. What now? Maybe you ate infected raw meat, or perhaps you drank contaminated water. Well, that’s less important now; they’re in your body. How bad it might get depends on whether it’s a lava or an egg. Option on…
Volume of rectangular pyramids using cubes | Grade 7 (TX TEKS) | Khan Academy
We’ll be exploring the volumes of rectangular pyramids today with cubes and rectangular prisms. This is a cube; all the sides are the same length. To find the volume of a cube, I can multiply the length by the width by the height. For example, if the leng…
11 Things You Should QUIETLY ELIMINATE from Your Life | Marcus Aurelius Stoicism
[Music] Marcus Aurelius, the stoic philosopher king, once said, “Our life is what our thoughts make it.” This profound insight lays the foundation for this video, where we’ll show you 11 vital things you need to quietly cut out of your life. We can trans…
The fastest private jet deal I have done
One of my most memorable quickest deals was actually getting a phone call from somebody saying he wanted to buy a certain airplane. I told him that the airplane was really just ready to be under the contract. He said he wanted to buy something immediately…
How to (quickly) make progress in life
Hey, what’s up person? Are you frustrated with your life? No? Are you, uh, tired of spinning your wheels and you keep on watching self-improvement videos trying to find that “aha” moment? The thing that gets you out of your rut? If that’s you, stop that! …
Where does NASA keep the Moon Rocks? - Smarter Every Day 220
[Destin] What is this? Apollo 11, the first mission. [Destin] This is Apollo 11? [Andrea] The first mission, these are the samples, all the samples that were brought back from the Apollo 11 mission. [Destin] Is it still awesome for you? It’s awesome,…