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
2 step estimation example
We are told a teacher bought 12 sheets of stickers to use on the homework of her students. Each sheet had 48 stickers. At the end of the year, the teacher had 123 stickers remaining. Which is the best estimate for the number of stickers the teacher used? …
Desire Is a Contract You Make to Be Unhappy
Desire is a contract you make with yourself to be unhappy until you get what you want. You start becoming disturbed because you want something, and then you work really hard to get that thing. You’re miserable in the meantime, and then when you get that t…
Dog Duty Inspiration | Big Fish, Texas
Yeah, it’s uh, Nick. Ores is Tommy or Arthur around? Pops brought Jenny and dropped her. Brought the fish house with me, ‘cause ultimately knows that I’m going to take care of her. I’m the only responsible one down there. She just sits there on a desk an…
The Second Amendment | National Constitution Center | Khan Academy
Hi, this is Kim from Khan Academy, and today I’m learning about the Second Amendment to the US Constitution, which states that a well-regulated militia, being necessary to the security of a free State, the right of the people to keep and bear arms shall n…
Kevin O'Leary Jamming with Rock and Roll Legend Randy Bachman
Randy Bachman is a legend in the world of rock and roll. He’s earned over 120 gold and platinum albums and singles and sold over 40 million records over his long career as both a performer and producer. CBC Music has declared November as guitar month. In …
Intro to adverbs | The parts of speech | Grammar | Khan Academy
Hello grammarians! Today we are going to talk skillfully and patiently about adverbs and what it is that adverbs do. In order to do that, I think it might be useful to talk about what adjectives do first. So, adjectives can modify stuff. I should have be…