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
60 Startup Founders Share How They Met Their Co-Founder
How did you meet your co-founder? Yeah, it’s a funny story. So, uh, do you want to take this one? [Music] So we went to school, college, College, college. They’re both French, but actually, we met at Stanford in California. Week two of MIT, we went to …
How To Invest In 2024 (The BEST Way To Get Rich)
What’s up you guys? It’s Graham here. So, CNBC recently found that 63% of Americans would be unable to pay for a $500 emergency. When I first read this, my initial thought was that this is unacceptable and it has to change. After all, the unfortunate rea…
This Season On Valley of the Boom | National Geographic
Let’s try one with a little bigger smile. [rushing sound] [dial tone] [gagging] [dramatic sounds] [gun clicks] [horn honking] Oh my god. Shh. You see all that? It didn’t happen. [electronic music playing] Microsoft didn’t literally kill anyone. They were…
Life Below the Ocean Surface | StarTalk
So you know that’s a fish. Oh, that’s cool. He’s cute, or she. You can’t even tell. But what is that fish thinking? Is it like— is it nostalgia? Is it rage? Maybe I’m just projecting. But you can’t really tell what it’s thinking. It’s a mystery. It’s an e…
A method for sticking to habits
So it’s that time of year again. Everybody’s talking about all these crazy new habits they’re gonna start implementing in 2020 because in 2019 you weren’t living your real life. In 2020 though, that’s gonna be the real you. That’s gonna be the fully torqu…
Why Youtube Feels Boring Now
Behind me are 100 people and they range from the age one all the way [Music]. This is Mummy Pig. YouTube feels boring now. Those were the exact words my friend said to me as we talked about the current state of the platform. I asked him why he felt so, a…