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
The Science Behind James Cameron’s Avatar: The Way of Water | National Geographic
I’ve had this romance with the ocean my entire life. When I was a kid, I aspired to become a diver so I could go and see this wonder and this beauty myself. Then I spent decades, you know, exploring and enjoying that world. The Way of Water was an opport…
Density curve worked example | Modeling data distributions | AP Statistics | Khan Academy
Consider the density curve below. It’s depicted right over here; it’s a little unusual looking. It looks more like a triangle than our standard density curves, but it’s valid. Which of the following statements are true? Choose all answers that apply: Th…
Career trajectories are non-linear.
So this question is: What is the best advice you’ve ever received? Career trajectories are not linear. Especially if you start a company, you might actually bypass a bunch of things, but it might not feel that in the moment. A lot of people that start st…
Homeroom with Sal & John Dickerson - Tuesday, October 27
Hi everyone, Sal Khan here. Welcome to the Homeroom live stream. We have a very exciting guest today. We’re gonna have John Dickerson, who works for 60 Minutes, a CBS contributing analyst, contributes to The Atlantic, and also has written “The Hardest Job…
Freedom of Choice - Mind Field (Ep 5)
[pleasant music] - [sniffing] Ah, nothing like bacon and eggs in the morning. It’s a hearty meal that holds you together for the whole day. It’s a combination so obvious that it’s been around for as long as both foods existed. Humans naturally loved these…
2015 AP Biology free response 2 c d
Part C: A researcher estimates that in a certain organism, the complete metabolism of glucose produces 30 molecules of ATP for each molecule of glucose. The energy released from the total oxidation of glucose under standard conditions is 686 kilocalories …