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
iPhone 4 is for LOSERS? -- Wackygamer
Today was Thursday. We’re recording this Thursday, June 2nd. Exciting part: iPhone 4 launch! That’s not exciting. I went 7:00 a.m. this morning. You’re pathetic! No, I’m not. What the point of getting iPhone 4? Ione, what’s what’s what’s different with …
Types of catalysts | Kinetics | AP Chemistry | Khan Academy
A catalyst speeds up a reaction by lowering the activation energy, and there are many types of catalysts. First, we’re going to look at enzymes, which are biological catalysts. Let’s say that this represents our enzyme, and the place where the reaction oc…
How do you prepare yourself mentally to be an entrepreneur?
So how do you prepare yourself mentally to be an entrepreneur? What I will say is maybe borrowing a little bit from Buddhism or philosophical Hinduism, but it’s really this notion to try to not get attached to the outcome. Obviously, you’re going into en…
Outlasting the Enemy in Shok Valley | No Man Left Behind
On October 2nd of 2008, we received the mission to go conduct an operation in the northern province of Nurse T in Afghanistan. The mission was to conduct a raid on a high-value target. The plan was to infiltrate from the bottom of the valley and work our …
Ray Dalio: The 3 Biggest Issues for the Economy in 2021
[Music] So a few weeks ago, Ray Dalio, the founder of the world’s biggest and most successful hedge fund called Bridgewater Associates, he sat down with CNN to do an interview and give his updated thoughts and opinions on the economic situation heading i…
Is Something in Space Talking to Us? | StarTalk
So there are some signals that exist in the record books. Right? And to some, that means the aliens have already tried to contact us. In 1977, the Ohio State University had a big radio telescope. It’s been turned, I think, into a golf course now. But one …