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
People and Bears Live in Harmony in This Wildlife-Friendly Town | Short Film Showcase
[Music] [Music] [Music] [Music] I think one of the biggest challenges in the valley, and it’s been going on for over 20 years now, it’s been going on since the mid-80s, is the constant change of the landscape itself within the Bull Valley. Everybody’s hav…
Uncovering the Tooth Fairy | StarTalk
So, Tooth Fairy is an interesting dilemma when you’re a parent. Because right when they’re losing teeth, they’re supremely gullible. They’ll believe basically anything you tell them, because they don’t have their own sense of the world yet. Their understa…
The Next Great Reset | Why The UK Is Collapsing
What’s up, Graham? It’s Guys here and it’s official: the global economy is tanking. In the last 24 hours, Hong Kong and Chinese stocks crashed to a 13-year low. UK’s Prime Minister resigned under financial pressure, holding the shortest term ever in Briti…
How To Get Rich According To Ray Dalio
There are a million ways to make a million dollars, and in this video, we’re looking at one of them. Ray Dalio, the founder of Bridgewater Associates, the largest hedge fund in the world, is a role model for the world of finance. With a net worth of over …
An Island On the Brink of Collapse Makes a Huge Comeback | Short Film Showcase
[Music] Kakuta is a tiny islet in the Zanzibar archipelago off the coast of Tanzania in East Africa. [Applause] For centuries, Cotton’s have prospered by making a living off the land, and safe it is not the kind of place you’d expect to find people innova…
Global winds and currents | Middle school Earth and space science | Khan Academy
One of my favorite things to do is go camping. For me, there’s nothing better than getting outside, breathing in some fresh air, and taking a swim in my favorite river. Have you ever jumped into a river and felt that the deeper, cooler water closer to you…