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
Esteem | Vocabulary | Khan Academy
Hey there, wordsmiths! I must tell you I feel quite good about this word, esteem. Esteem, it’s a noun; it means respect. You can hold someone in high esteem, which means you have a lot of respect for them, or you can have high self-esteem, respect for yo…
Potential energy | Physics | Khan Academy
If you drop a basketball, then it’ll speed up as it hits the ground, right? Which means its kinetic energy increases. Let’s say 100 joules just to take simple numbers, okay? The question is: where did that kinetic energy come from? Well, one answer could …
paris vlog|becoming an adult, girls trip, shopping, eating out 🥐🇫🇷
People I know always say that I’m super lucky to have a supporting, loving, and caring family, but it’s not entirely true because of the problems that we had among our relatives. My parents taught me to respect, love, and protect our family. Since I hit p…
Sal Khan chats with Google CEO Sundar Pichai
It’s huge treat to have Sundar Pichai, CEO of Google, here. And you know I will give a little bit of a preamble more than I normally do. I think a lot of the team knows this, but it’s always worth reminding the team we wouldn’t be here on many levels if i…
Love and Science | Genius
[Music] No, it must be an anomaly. Tight again! I already have 20 times. It’s not an anomaly. This sample must contain a new element, a radioactive element. It would have to be hundreds, no thousands of times stronger than uranium. We must isolate it. We…
A Brief History of Grand Canyon National Park | National Geographic
The Grand Canyon. Enormous, iconic, breathtaking. 2019 marks Grand Canyon National Park’s 100th anniversary. But how did it get to be such a beloved destination? Archeological artifacts suggest that people lived in and around the canyon some 12,000 years …