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
Writing y = mx proportional equations worked example 1 | Grade 8 (TX) | Khan Academy
We are told in a rowing exercise Claudia completes 450 strokes in 15 minutes. Write an equation that can be used to find the number of strokes y she can row in x minutes. So, pause this video and see if you can figure that out. All right, now let’s think…
My Video Went Viral. Here's Why
Now, you may have seen this thumbnail on YouTube. I mean, I can actually basically guarantee that YouTube has been shoving this in your face like, “Click! Click! Click it again!” So you might be wondering why. Why did this video in particular go viral? We…
Introduction to price elasticity of supply | APⓇ Microeconomics | Khan Academy
We’ve done many videos on the price elasticity of demand. Now we’re going to focus on the price elasticity of supply, and it’s a very similar idea; it’s just being applied to supply. Now, it’s a measure of how sensitive our quantity supplied is to percen…
The Simple Secret of Runway Digits
While waiting on a plane during taxi ‘till takeoff, looking out the window, you may have noticed the giant number numbering the runway, say eight, which implies seven others exist, at least, but this is a flight out of L.O.L. Airport, in Nevada’s desert o…
All The Times We Were Wrong
If I told you right now that humans are “perfect” organisms, and that in our mothers’ wombs, we first are fishes, who then develop into amphibians, and then reptiles, birds, primates, before finally becoming what we know as human, I’m sure you’d look at m…
Phishing attacks | Internet safety | Khan Academy
Let’s say you get an email like this where it looks like it is from PayPal. It says “response required” really big, so this is a little bit scary. It says, “Dear you, we emailed you a little while ago to ask you for your help resolving an issue with your …