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
NERD WARS: Blizzcon Kerrigan, Lich King, Diablo and Deathwing 1/2
[Music] Hey guys, this is Jeff from Wacky Gamer. You had awesome BlizzCon nerd War suggestions! I’m really excited to go ask the fans. Meanwhile, go to Facebook.WackyGamer.com and you can contribute and see some of our pictures. I still have to go with …
Treating systems (the hard way) | Forces and Newton's laws of motion | Physics | Khan Academy
All right, this problem is a classic. You’re going to see this in basically every single physics textbook. The problem is this: if you’ve got two masses tied together by a rope and that rope passes over a pulley, what’s the acceleration of the masses? In …
Elizabeth Iorns on Biotech Companies in YC
So welcome to the podcast! How about we just start with your just quick background? Sure! So I’m Elizabeth Lyons. I’m the founder and CEO of Science Exchange, and I’m a cancer biologist by training. I did my PhD at the Institute of Cancer Research in Lon…
Better AI Models, Better Startups
Every time there’s an Open AI product release now, it feels like there’s a bunch of startups waiting with baited breath to see whether Open AI is going to kill their startup. This is actually a really crazy moment for all startups. Adding more types of mo…
Before the Flood - Trailer | National Geographic
We’ve known about this for decades, for over half a century. Try to have a conversation with anyone about climate change; people just tune out. Climate change, climate change, CH! The problem seems to be getting worse and worse and worse. The truth is, th…
Turn Short-Term Games Into Long-Term Games
Do you want to talk about Pareto optimal? Pareto optimal is another concept from game theory, along with Pareto superior. Pareto superior means that something is better in some ways while being equal or better in the other way, so it’s not worse off in an…