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 a quadratic function to fit data and estimate solutions | Algebra 1 (TX TEKS) | Khan Academy
We’re told Amtha is a high jump finalist at the World Athletics Championships. She tracks the heights of her practice jumps to get an idea of her capability during the competition. And so, this is timing the air intense of a second. This is height in feet…
Climate Change: It’s Real. It’s Serious. And it’s up to us to Solve it. | National Geographic
Climate change. It’s real, it’s serious, and it’s up to us to solve it. In the last two decades, we’ve experienced 14 of the hottest 15 years on record. By 2050, drought and chronic water shortages could impact a billion people, while millions more will …
Safari Live - Day 198 | National Geographic
This program features live coverage of an African safari and may include animal kills and carcasses. Viewer discretion is advised. Good afternoon, and a very warm welcome to a sunny, beautiful afternoon in South Africa. As you can see, there are some big…
Anthony Bourdain and "the Sweet Spot" | StarTalk
So even something as simple as scrambling an egg is essentially a scientific manipulation of an ingredient by exposure to both heat and movement, and incorporating an area making it behave—an egg behaving in the desired way. It reminds me—this is an obsc…
It’s Impossible to Predict the Future Growth of Knowledge
Stephen Hawking famously said, “People are nothing special; people are chemical scum on a very typical planet orbiting an average star in the outer suburbs of a very typical galaxy which is one among hundreds of billions of galaxies in the universe.” Thi…
The Napkin Ring Problem
Hey, Vsauce! Michael here! If you core a sphere; that is, remove a cylinder from it, you’ll be left with a shape called a Napkin ring because, well, it looks like a napkin ring! It’s a bizarre shape because if two Napkin rings have the same height, well t…