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
You’re Not Lazy : How To Force Your Brain To Crave Doing Hard Things
I found myself struggling to stick with the gym, eat healthy, or reduce my alcohol consumption, even though I know it’s good for me and probably what I’m supposed to be doing. For the last 5 to 6 years, I struggled with binge eating and body dysmorphia qu…
Increased politicization of the Supreme Court | AP US Government and Politics | Khan Academy
In your mind, why is the Supreme Court important? Well, the Supreme Court is important for the original founders’ reasons, or that it was like all American institutions. There were ideas the founders had, and then John Marshall, an important justice, cre…
Warrior Watch: Protecting Kenya's Lions | Explorers in the Field
[Music] [Music] My father was Saawariya and they used to kill many, many, many Lancia. He used to tell me how dangerous Lancer. I used to hate Lance. [Music] When I was a young boy, I thought I would be growing up and killing Lance, but now we protect the…
Diving Between the Continents (Silfra, Iceland) - Smarter Every Day 161
Destin: “You wanna do it, yeah, do it.” “Very good.” “Hey, it’s me Destin, welcome back to Smarter Every Month… day! Smarter Every Day.” “If you’ve never had four children, you know that four children are a handful.” “Today on Smarter Every Day, my wife …
#shorts How Will Robots Affect These Jobs?
Robots don’t pay taxes or even spend money in the local communities. They should preserve their jobs. My question to you is, can they stop progress? Uh, first of all, there’s no evidence that that’s true. There have been lots of studies on automation in …
Live from Mars 360° | National Geographic
You [Music] Welcome to the second season of Mars! I am Samuel, TV, I play Rubber for Car, and this is a beautiful Clementine for that Sand. I play Dr. Emily Johan, and we are in our beautiful studio in Hungary at Court. Last video, which is like one of t…