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
Bill Ackman: The Real Estate Market is "Falling Off a Cliff"
I do think the economy is weakening, and I have some concerns. Billionaire investor Bill Amman just issued a dire warning message on the future of the real estate market and economy. Amman is the founder and CEO of Pershing Square, one of the most well-re…
The Hazards of High Altitude: A Mistake on the First Attempt | Edge of the Unknown on Disney+
[Music] When you’re climbing on a Himalayan giant, you have no margin for error. Altitude is this invisible, debilitating challenge that you face. Leaning over to even tighten your boots can put you out of breath. Decision-making becomes much slower becau…
Play in a City That Is Both Urban and Wild | National Geographic
[Music] Even the oldest of places can be seen through new eyes. Quebec City brings to mind European vibe, history, and old architecture. This city is all about 400 years old, actually. So just wandering each neighborhood is an experience in itself. After…
The age of empire | Rise to world power (1890-1945) | US History | Khan Academy
So I have a map here of United States possessions in the Pacific and in the Caribbean today, and they’re kind of all over the place. I mean, some of them are pretty tiny. There’s Guam, which is just barely a little speck on the map, and American Samoa. An…
When Sex Turns Lethal | Original Sin: Sex
In modern day Monaco, if you want to get married, you need to post a written announcement on the town hall for 10 days. Across the globe, governments love to legislate who can and can’t get married for reasons of control, paranoia, or fear. Scientists at …
Revealing The INSANE Perks of The $10 Million Dollar Credit Card
What’s up, guys? It’s Graham here. So, two years ago, I did a thing. I was able to obtain what many people would consider to be the holy grail of credit cards, one that very few people even know exists. If you think that’s a weird thing to say, that’s bec…