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
Multiplying complex numbers graphically example: -3i | Precalculus | Khan Academy
Suppose we multiply a complex number z by negative 3i, and they show us z right over here. Plot the point that represents the product of z and negative 3i. So pause this video and see if you can work through that. All right, now let’s do it step by step.…
Graphing two variable inequality
So what I would like to do in this video is graph the inequality negative 14x minus 7y is less than 4. And like always, I encourage you to pause this video and see if you can graph it on your own before we work through it together. So the way that I like…
Food Fight! The Big Genetically Modified Food Debate
Genetically modified foods are one of the most controversial concepts of today’s modern world. Genetically modified foods have had specific changes introduced into their DNA. Crops undergo this process to have desirable traits, like a brighter color, a sm…
This Is What War Looks Like | Chain of Command
MAN: [inaudible]. MAN: They’re right here. They just went in this building. Enemy just went into this building. [inaudible]. CAPTAIN QUINCY BAHLER: Sayidi, I need them to say that nobody is in there. MAN: [inaudible]. CAPTAIN QUINCY BAHLER: Are there …
What Happens When Cape Town Runs Out of Water? | Short Film Showcase
I think the question on everyone’s minds is: how did Cape Town get here? 2013, which was only five years ago, we had the record rainfall year where lots and lots of water dams were full. In 2014, we had a drop in those dams. When we got to the 1st of Octo…
How To Cure "Brain Fog" | 3 Tips for Mental Clarity
[Music] You know someone who wants to taper off caffeine? I’m not doing a very good job; having an espresso machine right next to my desk is very dangerous and probably a stupid idea. So, you know, it’s pretty crazy. The human brain is pretty crazy; it’s…