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 Footage: Hiking to Machu Picchu | National Geographic
[Music] [Music] Tracy wanted to do Machu Picchu, and I wanted to do the mountains. So that enabled us to put the two together to do Salkantay through to Machu Picchu, which without the crowds, yes, as well. I just like physically challenging myself, and a…
Opening a bank account | Banking | Financial Literacy | Khan Academy
So let’s think about what’s involved when you decide to open up a bank account. Well, the first step is where you want to open it and what type of account you want to open. So your choice of bank might depend on things like the interest that they might g…
When The Housing Crash Will Happen
What’s up you guys? It’s Graham here, and if you thought the housing market was expensive, it got worse. Despite higher interest rates, record low affordability, and a 60% chance of recession, the housing market is now $2 trillion more expensive. That’s r…
4 Ways to CURE Social Media Addiction and GET WORK DONE
Hey, it’s Joey, and welcome to Better Ideas. Now, a lot of people in this highly digital, social media-driven society are finding it increasingly difficult to get work done without getting distracted by social media. I’ve experienced the same problem, whe…
Finding z-score for a percentile | AP Statistics | Khan Academy
The distribution of resting pulse rates of all students at Santa Maria High School was approximately normal, with a mean of 80 beats per minute and a standard deviation of nine beats per minute. The school nurse plans to provide additional screening to st…
Ratios with tape diagrams (part:whole)
[Instructor] We’re told that Peni wrote a survey with open-ended and multiple-choice questions. The diagram shows the ratio of the question types. So what it shows us is that for every one, two, three, four, five open-ended questions, there are one, two, …