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
2015 AP Biology free response 2 c d
Part C: A researcher estimates that in a certain organism, the complete metabolism of glucose produces 30 molecules of ATP for each molecule of glucose. The energy released from the total oxidation of glucose under standard conditions is 686 kilocalories …
Ask Sal Anything! Homeroom Wednesday, July 15
Hi everyone! Welcome to our homeroom live stream. Sal here from Khan Academy. Uh, before we get into, uh, our guest, who is me today, it’s just going to be an ask me anything type of thing. So actually start putting your questions on Facebook and YouTube…
Patrolling the Bay on the New Hawk Five | To Catch a Smuggler: South Pacific | National Geographic
Summer in the Bay of Islands sees many yachts visiting from overseas, so Customs have their work cut out for them keeping the country’s coastal border safe. Today they’re patrolling on the new Hawk Five. It’s a serious vessel, loaded with tech, and can tr…
How A Ponzi Scheme Works
So you may have heard about Ponzi schemes in the news. Everybody knows they’re illegal, but you might not understand how they work. So Ben is here to show us. To start off, Ben gets a few people to invest their money with him. At the end of the year, he …
Bradley Cooper attempts to cross a snowy ravine on his own | Running Wild with Bear Grylls
Key things that Bradley needs to remember this morning is all the intricacies of firing that grappling gun. Then he’s got to secure that line; if necessary, use that Vector system to double up that strength. Then he’s got to commit to it and go for it bec…
What a Long, Cold Trip It’s Been | Continent 7: Antarctica
ETHAN: Your fingers freeze up and get cold. And they feel like you’ve got a glove on even when you don’t. It becomes almost impossible to do some of the things you’ve got to do. I’m handling metal with bare hands. MAN 1: Put it in your mouth. And then it…