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
Most Startups Are Undercharging - Dalton Caldwell
Most of the time, people are way undercharging for their product. For some reason, there are ideas out there that you should either not charge for your product or you charge such a tiny fraction of what you could be charging that you’re not set up for suc…
Science Fair – Trailer | National Geographic
The winner in the category of Medicine, making it ties—that’s like the big thing. You kind of had that status of being in, like, the group I would say that a lot of people are jealous of. On deadlines, I’m awful. I wait until the deadline to start workin…
Impact of mass on orbital speed | Study design | AP Statistics | Khan Academy
Let’s say that we’ve come up with a new pill that we think has a good chance of helping people with diabetes control their blood sugar. When someone has diabetes, their blood sugar is unusually high, which damages their body in a bunch of different ways. …
The Real-Life MacGyver in Nat Geo’s Basement | Podcast | Overheard at National Geographic
I want you to imagine a photograph. Okay, we’re way up north in the Canadian Arctic at a place called Ellsmere Island. This is a land where packs of white Arctic wolves prey on oxen. Okay, picture big shaggy buffalo with thick curling horns. All right, ou…
Reversion to the Mean
It’s a cold winter morning. You wake up fresh and rested. You get ready and go to the nearest cafe to start the day with a cup of coffee. You order your favorite: an iced caramel latte. As you wait for your coffee, you make small talk with the stranger ne…
God's Thieves | Saints & Strangers
This desecration is unwise. We should not ransack their supple. Curse these people; aren’t Christians; therefore, there’s no desecration in Giethoorn for God. Saint, wait! It is most likely seed corn for planting come spring. What? The village is abandon…