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
Should You Start A Startup? | Startup School
Foreign [Music] I’m Hodge Tiger, one of the Group Partners at Y Combinator. Today, I’m going to talk about whether you should start a startup. Because YC invests in startups so early, I’ve spent a lot of time with people who aren’t yet sure if they should…
15 Things Rich People Advise But Never Do
Everyone looks for advice from the rich, but advice is not universally applicable, and even they don’t follow it, and for good reason. Here are 15 things rich people advise but never actually do. Welcome to Alux. Number one: go to school. Going to school…
What All Investors Need to be Considering (w/@MinorityMindset)
Hey guys, and welcome back to the channel! So, just the other day, I had the privilege of sitting down with Jaspreet Singh from the Minority Mindset for about 40 minutes, which was really, really cool. If you don’t know Jaspreet, he has over a million sub…
Free Solo 360 | National Geographic
Anybody could conceivably die on any given day, and we’re all gonna die eventually. [Applause] So, Lange just makes it far more immediate. You accept the fact that if anything goes wrong, you’re going to die, and that’s that. [Music] I wasn’t the kind of…
Alaska Twins Live Off the Land 150 Miles From the Nearest Store | National Geographic
This is a very physically demanding way of life. There’s been times where I’ve been skiing for eight or ten hours through deep snow and stopping to maintain traps. I’m really tired and I’m hot and I’m sweaty, and I know that I’m just one sprained ankle aw…
THE NO. 1 HABIT OF BILLIONAIRES RUN DAILY - TONY ROBBINS MOTIVATION
Let me ask you something: what would you do if you knew your success was inevitable? If you had absolute certainty in your future and could see the steps you need to take clearly, what would you focus on? What would your daily habits look like? Here’s th…