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
Q&A With Grey: 500,000 Subscribers Edition
Hello Internet, Here we are: 500,000 subscribers – well, actually… by the time I finished this video it’s a bit more than that – but who knew that after I promised to do a Q&A that the pope would resign? Anyway… When I uploaded my first explanation …
Constitutional powers of the president | American civics | US government and civics | Khan Academy
So this is here, um, I’m here with Jeffrey Rosen, head of the National Constitution Center, and we’re going to talk about Article Two of the United States Constitution. So, Jeffrey, what does Article Two deal with? It deals with the executive power, the…
The REAL potential of generative AI
You’ve heard of large language models like Chat GPT, Chat GPT, Chat GPT, Chat GPT. They can answer questions, write stories, and even engage in conversation. But if you want to build a business that uses this technology, you’ll need to ask yourself an imp…
Comparative advantage - input approach | Basic economic concepts | Microeconomics | Khan Academy
We just finished demonstrating how to calculate opportunity costs and determine who has the comparative advantage in a goods production using the data provided at an output table or production possibilities curve. In that video, we had a table showing the…
Pronoun number | The parts of speech | Grammar | Khan Academy
So here’s something weird and cool about English and languages in general: they have a sense of number kind of encoded into them. We call this grammatical number. The way this plays out is in the difference between singular and plural in English; the idea…
From Summit to Subterranean: Chasing Adventure in San Antonio, Texas | National Geographic
When you’re in the cave, you’re so hyper-focused because there’s no distractions, and so for me, it’s almost meditative. [Music] I started in adventure photography with winter sports. Now I’m here in Texas to find that adventure, but underground. Hi, it…