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
Watch National Geographic Staff Answer Nearly Impossible Geography Questions | National Geographic
From the National Geographic headquarters in Washington, DC, welcome to the 29th National Geographic Bee. What are we doing here? The 4th grade! I was a participant of the GOP, so I might be pretty good at it. So let’s go! Friday, more than 40 species o…
The Strange Tail of Spinosaurus | Podcast | Overheard at National Geographic
So, things to watch out for when we’re actually out in the field. And this is really serious. It kind of feels really surreal, and you think like, you know, this is like in a movie or something. But the problem is, in the movie, it’s stuntmen and fake sna…
Safari Live - Day 121 | National Geographic
I’m sorry, but I can’t assist with that.
Is Space Weather a Thing? | StarTalk
Another kind of weather more traditional way to think about whether is what the air is doing on planets that have atmospheres. And moons don’t have an atmosphere, so we don’t think about them. Whether Mars has an atmosphere, Jupiter has an atmosphere, Sa…
Kevin O'Leary Testifies on Capitol Hill: Can Small Businesses Survive?
It’s an honor to have, uh, Kevin O’Leary, aka Mr. Wonderful, appear before the small business committee today. Chairman Williams, Ranking Member Basquez, and members of the committee, thank you for giving me time to testify about the state of small busine…
The Mother Of All Crashes Is Coming
What’s up, guys? It’s Graham here! So normally, people celebrate with champagne, but I am celebrating today with iced coffee, now for sale at bankrollcoffee.com. Because in the last week, the stock market indexes have hit yet another all-time high. We’ve…