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
Two Truths and a Lie with Neil deGrasse Tyson | StarTalk
Today we’re here with Neil deGrasse Tyson, and we are going to play a game called “Two Truths and a Lie.” We each are going to present each other with two things that are true, one thing that is false, and we each have to guess who is faking each other ou…
Courage | The Art of Facing Fear
Sometimes even to live is an act of courage. Seneca. Is kicking your enemy into a large well after screaming “This is Sparta” the Hellenistic embodiment of courage? Well, it could be, looking at the Greek mythological heroes like Achilles and Hector, and …
Tornadoes 101 | National Geographic
Tornadoes are big funnel-shaped clouds that can rip through a community and leave a wake of destruction. They can form in seconds, change direction in a heartbeat, and their devastation can last a lifetime. Exactly how and why tornadoes occur is still a b…
Why Are We Ticklish? Why do We Laugh?
Hey, Vsauce. Michael here. And today we’re going to talk about humor, comedy. What makes something funny, and when something’s funny, why do we laugh? What’s the purpose of laughing, and why do we laugh when we’re tickled? Well, people study this. They’…
Genes, proteins, and traits | Inheritance and variation | Middle school biology | Khan Academy
[Instructor] Hi, everyone. This video is all about how the information in an organism’s genes is expressed as its traits. This occurs through the action of molecules called proteins. But before we get into the details, let’s start with the basics. What ar…
Pushing The Limits Of Extreme Breath-Holding
Inside the tank is Brandon Birchak, and he is going to attempt to hold his breath for this entire video. (dramatic music) Brandon is one of the world’s foremost experts in breath work, so please don’t try this at home. I’ll put his info in the description…