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
Death Along the Ganges River | The Story of God
Bodies have been cremated on the banks of the River Ganges for hundreds of years, bathed in the waters of their holy river, wrapped in linen, and placed on a wooden pyre. The dead are consumed by flame. Swami Barista, a monk and a doctor, is my guide to d…
What are SMART goals and why do they matter? | Financial goals | Financial Literacy | Khan Academy
So let’s talk a little bit about smart goals when it comes to your finances. When I say smart goals, I’m not just saying well-thought-out or intelligent goals, although I guess it could be that. I’m talking about the acronym S-M-A-R-T: smart goals. Now, …
Meet Madeline, the Robot Tamer | Short Film Showcase
[Music] I’m really passionate about inventing better ways to communicate with machines that can make things. For a long time, industrial robots have been the culprit of automation and replacing human labor. Basically, all the easy tasks to automate have …
15 Traits of a Good Life (2023)
Let’s start the new year with a bang! The A-Lux lady is still enjoying her holiday break, so I’m here to take over this one for her. But no worries, she’ll be back next Sunday. You will never guess what you don’t plan for, so it will serve you well to lea…
Mako and Tiger Sharks: Photographing the Ocean’s Top Predators (Part 2) | Nat Geo Live
The first story that I wanted to share of this new work is a story about Tiger Sharks. Now, Tiger Sharks if you read the literature are described as the most dangerous sharks in tropical waters. They are considered the second most dangerous species of sha…
Homeroom with Sal and Wendy Kopp - Wednesday, September 15
Hi everyone! Sal Khan here from Khan Academy. Welcome to the Homeroom live stream! It’s been a while since we did one, but we’re back and we have an amazing guest, Wendy Kopp, CEO of Teach For All, also the founder of Teach For America. We’re going to ta…