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
Photographing the Devastating Impact of Breast Cancer in Uganda
( intro music ) In 2013, I was asked to cover breast cancer in Uganda. Breast cancer has less than a handful of oncologists in the whole country. A woman who has breast cancer thinks of it as a death sentence. Most of the resources in Uganda went to HIV-…
REVEALING MY NEW LAS VEGAS HOME TOUR | LEAVING CALIFORNIA
What’s up you guys, it’s Graham here. So last week, I posted a video explaining why I’m leaving California, and since then, so many of you guys have been asking for a home tour. So here we go, it’s officially official! Welcome to the brand new house all t…
Relative maxima and minima worked example
This is the Khan Academy exercise on relative maxima and minima, and they ask us to mark all the relative maximum points in the graph. Like always, pause this video and see if you can figure out which are the relative maximum points. Okay, now let’s work…
How Finding Blue Whale Poop Changed My Life | Nat Geo Live
I was seeing six blue whales in an area the size of a soccer pitch. I’ve gone on to name them the “unorthodox whales,” because they actually break the stereotypes we had for this species. It has sent me on an incredible adventure. (audience clapping) It w…
Extremely Rare White Lions Caught on Camera | Short Film Showcase
[Music] Well, we set off from Cape Town, and we’ve arrived here in this beautiful area known as the Wetlands Concession. This area is situated in the far eastern corner of Kruger National Park. As I worked here for a number of years, I got to know these l…
Why you shouldn't vent anger (according to science and philosophy)
We may all be familiar with the irritation arising when something doesn’t go as we wish. We feel our heartbeat increasing and our muscles tensing. Our frustrations build up to the point of physical shaking, and we feel we’re about to explode. And so, when…