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
Weak base–strong acid reactions | Acids and bases | AP Chemistry | Khan Academy
Ammonia is an example of a weak base, and hydrochloric acid is an example of a strong acid. Ammonia reacts with hydrochloric acid to form an aqueous solution of ammonium chloride. Because this is an acid-base neutralization reaction, there’s only a single…
Exoplanets 101 | National Geographic
(Dramatic music) [Narrator] They are nestled in the final frontier, countless worlds scattered throughout countless galaxies, challenging the notion that we are alone in the universe. Exoplanets are worlds that exist outside of our solar system. Also kno…
Gender Revolution: Live Aftershow with Katie Couric | National Geographic
Hi everyone! Thank you so much for being here and thanks to so many of you who just tuned in to watch Gender Revolution on National Geographic. My hope was always that this film could be a conversation starter for people all across the country and around …
BlackRock - The company that owns the world?
Narrator: There’s a good chance you’ve never heard of BlackRock. Founded in only 1988 in less than 30 years this American financial firm would grow to become “the company that owns the world” managing assets worth 6,3 trillion dollars. These are assets t…
The 5 BEST Credit Cards For Beginners In 2023
What’s up guys, it’s Graham here! So a year ago, I made a video going over the best credit cards of 2021. However, recently I realized that there’s a bit of a problem in that today is the future, and thanks to the introduction of some new credit cards, w…
Traditional Norwegian Cuisine | Gordon Ramsay: Uncharted
[Narrator] Gordon Ramsay headed to Norway to learn how to cook like a true Viking. But how this region developed some of its traditional dishes happened long before these explorers took to the seas. I want to move to Norway. (laughing) (gentle music) [N…