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
Tiny Fish Use Bacteria to Glow in the Dark | National Geographic
(Calming music) - I was in the Solomon Islands on a National Geographic expedition. We were working in a shallow reef, and we had a big blue light that we were filming fluorescent corals. One of the safety divers, Brendan Phillips, came up to me and just …
House Hack: How to live FOR FREE by investing in multifamily real estate
What’s up you guys, it’s Graham here. So, as your real estate agent and real estate investor, I’m going to be sharing with you guys exactly how you can cover all of your housing expenses and essentially live for free without ever having to pay rent or com…
End behavior of algebraic models | Mathematics III | High School Math | Khan Academy
A barista poured a cup of coffee. The initial temperature of the coffee was 90 degrees Celsius. As time t increased, the temperature c of the coffee began to decrease exponentially and approach room temperature of 20 degrees Celsius. Which of the followi…
Lumberjack For a Day | Dirty Rotten Survival
The guys are felling one tree each in order to build a highly ambitious lumberjack camp designed by Johnny. “Oh Johnny, I didn’t get to say timber!” “Oh, pretty close, John.” “Johnny, 22 inches! 22! 22! You really are humming, jerk.” “All right, Dicky…
Can YOU Fix Climate Change?
Never before in human history have we been richer, more advanced or powerful. And yet we feel overwhelmed in the face of rapid climate change. It seems simple on the surface. Greenhouse gases trap energy from the Sun and transfer it to our atmosphere. Thi…
Mentoring New Photographers | Sea of Hope: America's Underwater Treasures
So, is lighting the whole secret down there? Yeah, I think one of the best things, um, to do underwater is to sort of meter for the background, the ambient, and then maybe underexpose that just a little bit. It kind of creates a nice, richly saturated bac…