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
Breaking Addiction is Socially Unacceptable
If you drink alcohol or if you take some kind of drug regularly, tried to follow any thought experiment. What events do you most look forward to? I will bet you there are the events where you get to do these things. So if you drink alcohol, you look forwa…
Derivative as a concept | Derivatives introduction | AP Calculus AB | Khan Academy
You are likely already familiar with the idea of a slope of a line. If you’re not, I encourage you to review it on Khan Academy. But all it is, it’s describing the rate of change of a vertical variable with respect to a horizontal variable. So, for examp…
Best Crypto To Buy Right Now | Kitco NEWS
[Music] So in this environment, Roy, give me your top DeFi or crypto investment. Is there an altcoin that you think has room to rally? Give me, in two sentences, your top investment in the space right now. “I’m going to disappoint you right now because I…
Your Mass is NOT From the Higgs Boson
Twenty-one grams. That is the mass of all of the electrons in your body if, like me, you weigh about 70 kilograms. Now, all of the mass comes from the Higgs mechanism, which means that as your electrons are traveling through space time, they interact with…
Torque and kinematics conceptual example
We are told a student hangs blocks with different masses from a pulley of mass m and radius r and releases them from rest. The student measures the time of the fall t and the magnitude of the angular velocity omega sub f when the block reaches a distance …
Warren Buffett's Most Iconic Lecture EVER (MUST WATCH)
You would be better off if when you got out of school here, you got a punch card with 20 punches on it. Every big financial decision you made, you used up a punch. You’d get very rich because you’d think through very hard each one. If you went to a cockta…