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
Honey hunting in the dead of night | Primal Survivor: Extreme African Survivor
I definitely would not want to fall from this height. We need to get to the hive out of the branches and lower it down. We’re going to bring it down. We’re going to lower it. This thing is heavy, yeah, I have it. Bees release pheromones when they’re threa…
Long run supply curve in constant cost perfectly competitive markets | Microeconomics | Khan Academy
[Man] Alright, now let’s dig a little bit more into analyzing perfectly competitive markets, and in particular, we’re gonna focus on the long run. Remember, the long run is the time span where firms can enter and exit the market. Or, another way to think …
3 Ways the World Order is Changing
I’m desperately trying to pass along, uh, my thoughts to help you to understand how the world order is changing. Um, and it’s changing in three very important ways. It’s changing financially and economically in important ways that you could see. It’s chan…
The Fermi Paradox: Where are all the Aliens?
Liftoff from a tropical rainforest to the Edge of Time itself. James Webb begins a voyage back to the birth of the Universe. On December 25th, 2021, NASA launched the successor to the Hubble Space Telescope, the James Webb Space Telescope. Hubble has pro…
Two Classes of Bitcoin? | Kitco NEWS
Joining me now is serial entrepreneur, Shark Tank star, and chairman of O shares ETFs, the one and only Kevin O’Leary, Mr. Wonderful. Wonderful to have you back with us! Great to be here. Thank you so much! All right, so Kevin, Jamie Dimon is saying tha…
The Hindu Interpretation of Creation | The Story of God
In the beginning, Hindus believed Ganga flowed in the heavens, but she was held captive by the creator god Brahma. Then Brahma decided to send the river Ganga down to Earth, but there is one problem: Ganga has got such mighty floods, and if she comes on E…