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
Apoptosis | Cell division | Biology | Khan Academy
Hello Emily, hello David. So we’re here today to talk about apoptosis. Uh, I was going to ask you some questions about it; you were going to explain what it even is to me. Absolutely. Okay, talk apoptosis. So, this word apoptosis—I did a little bit of …
if-elif-else | Intro to CS - Python | Khan Academy
We can use an if statement to control that a particular block of code only executes when the condition evaluates to true. But what if we want to do something else only when the condition evaluates to false? Well, we can add another if statement and try an…
The Crux Episode 4 | Full Episode | National Geographic
Growing up, I watched the Olympics when they were in Vancouver, and I thought, wow, it would be really cool to be one of those athletes one day. But I never thought it would actually come true. It did on the first Olympics ever, which is like even more sp…
Sal Khan and Francis Ford Coppola fireside chat
All right, so very exciting, uh, we’re here at Khan Academy with the team, and we have some students from Khan Lab School as well, uh, with, uh, the I’d say legendary Francis Ford Coppola, uh, most known for film making. Uh, I, you know, obviously The Go…
Saving Manatees: What It Takes - Meet the Expert | National Geographic
So good to see you all again! I’m so excited for this time every week. Um, we get the opportunity to chat to a wonderful scientist, or expert, or conservationist live somewhere in the world, and we get to chat about some of their awesome research projects…
The 5 Major Forces Coming Together to Make 2024 a Pivotal Year
I think there are five major forces that repeated through history, and those are the debt money economic force, the internal conflict force, which is the big, uh, conflict in terms of the elections and so on, the external geopolitical force, which is the …