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
The 2023 Recession Just Started | DO THIS NOW
What’s up guys, it’s Graham here. So, as it turns out, we might very well be seeing the beginnings of a 2023 bear market. In fact, the slowing inflation was just reported: more than a third of small businesses couldn’t afford to pay all of the rent in Oc…
When Cities Were Cesspools of Disease | Nat Geo Explores
Imagine living in darkness. You’re in a roof the size of a closet with your entire family. I can’t see a thing, but you can hear and smell everything—every breath, every sneeze, every cough that hits your face. This is life in a 19th-century city. There’…
All right, this is Jeff from Wacky Gamer. You guys had a bunch of awesome nerd board suggestions. I’m answering them today by asking: the cosplayer Adam West versus Christopher Reeve. Adam West. Adam West. And why? Christopher Reeve? Uh, Adam West! Adam …
Tuna Gremlin | Wicked Tuna
Yo, there he is on the down! Rod, oh my God, got him on! Got him on, get him on, get up there! Got him on, wo! Come off on the bite. Oh dude, what happened that time? There’s no weight, no nothing. I don’t know—we’re at the bottom of the fleet, and we’re…
15 Things Rich People Advise But Never Do
Everyone looks for advice from the rich, but advice is not universally applicable, and even they don’t follow it, and for good reason. Here are 15 things rich people advise but never actually do. Welcome to Alux. Number one: go to school. Going to school…
A Spoon You Can Eat Is a Tasty Alternative to Plastic Waste | Short Film Showcase
I ordered for idli sambar, and this pool is put in it. So, as he was putting the spoon, I grabbed it from his hand. I run my thumb on it; it was greasy. I took a smile and a sniff of it. It was already smelling of somewhere it’s been reused. You know, pla…