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
Current | Introduction to electrical engineering | Electrical engineering | Khan Academy
All right, now we’re going to talk about the idea of an electric current. The story about current starts with the idea of charge. So, we’ve learned that we have two kinds of charges: positive and negative charge. We’ll just make up two little charges like…
Why do we launch rockets from Florida?
Why do we launch rockets in Florida? I remember as a kid just not getting it as I watched these rocket launches get scrubbed due to bad weather. I was like, you guys know that’s Florida, right? That’s where they get the hurricanes and the thunderstorms. A…
Finding decreasing interval given the function | Calculus | Khan Academy
Let’s say we have the function ( f(x) = x^6 - 3x^5 ). My question to you is, using only what we know about derivatives, try to figure out over what interval or intervals this function is decreasing. Pause the video and try to figure that out. All right,…
8 Strengths Of Introverts
By many, being introverted is seen as a weakness. Introverts rather stay on the background, often hesitate to make a decision and get fatigued by social interaction. But these so-called weaknesses are easily compensated by a series of strengths that are g…
Why Dyslexia Might Just Be a SUPERPOWER | Kevin O'Leary
[Music] Well, when I was growing up, I was born from immigrants: an Irish and Lebanese father, Lily’s mother. By the time I hit seven, it was clear I had some really big problems in math and reading. Going back to the education, I had a really bad case o…
Traps on the Land (Clip) | Alaska: The Next Generation
It’s a hard life out here. So a goal is to go out trapping and get some fur. And the animals out here that are growing with the land will make garments that are meant to be on this land. This is what I’m looking for right here. I got a natural game trail…