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
Photoperiodism | Plant Biology | Khan Academy
So one question that biologists have long asked is: how do plants know what to do at different times of the year? One mechanism by which they know, kind of, you could say what time of year it is, is through photoperiodism. “Photo” for light and then “peri…
The U.S. Interest Rate Problem Just Flipped (Jerome Powell Changes Stance)
If you’ve been paying attention to the stock market recently, you’ll have noticed it’s currently nose diving. It’s nothing crazy yet; it’s definitely not a stock market crash. But the S&P 500 is down around 5% since just last week. If you’re wondering…
12 Gauge Dragon's Breath AT NIGHT!- Smarter Every Day 2
[music] OK, so we are about to demonstrate Dragon’s Breath ammo, the ultimate in muzzle flash, and we got the most manly person we know, John, to do it. John, can you hear us? - Yeah - Are you ready? - Ready. 3…2…1… [bang] [laugh] [music] What if you c…
How Much Income You Need To Save (By EVERY Age)
What’s up, me guys? It’s Graham here. So, it’s recently said that nearly a third of Americans would go broke in less than a week if they lost their job. To make matters worse, 55% of Americans have less than $1,000 saved. 70% admit to bad spending habits,…
How To Get Rich According To Mark Cuban
There are a million ways to make a million dollars, and today we’re looking at how Mark Cuban’s done it. For those of you who live under a rock, Mark Cuban is an American serial entrepreneur, investor, one of the main sharks from Shark Tank, and he also o…
The Power of Thinking For Yourself
On the 23rd of March 2016, Microsoft released a new chat bot named Tay on Twitter. Described by Microsoft as an experiment in conversational understanding, Tay was built to have conversations with people through tweets and DMs. With the slaying of the int…