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
From the Frontlines to the Shorelines | Podcast | Overheard at National Geographic
[Music] Now for the marine forecast for Waters within five nautical miles from shore on Western Lake Superior, from Fort Wayne to Bayfield to Saxon Harbor, Wisconsin, and the outer Apostle Islands. It’s summer 2021, time of this radio broadcast. National…
Causes of shifts in currency supply and demand curves | AP Macroeconomics | Khan Academy
Talk a little bit about what could cause the supply or demand curve for a currency to shift. So here we have the foreign exchange market for the Chinese yuan, which is why we have the quantity of one on the horizontal axis and the price of one in terms o…
How I Escaped Corporate Hell (They Don't Want You To Know This)
Speaker: To raising your vibration, this is the video version of my podcast. If you want the audio version you can click the link in the YouTube description. Apologies guys, if you’re listening on the audio that was a YouTube intro and vice versa. If you …
How to Stop Hating Yourself
Everyone has moments of dislike of themselves at some point in their lives. It could be because of something we’ve done, some aspect of our bodies, or maybe we believe we’re just not good enough. Whatever the reason, disliking ourselves means we’re not co…
Warren Buffett on One Last Day with Charlie Munger | Berkshire Hathaway 2024
Hi, my name is Andrew Ncas, and I’m wondering if you had one more day with Charlie, what would you do with him? [Applause] Well, it’s kind of interesting because, in effect, I did have one more day. I mean, it wasn’t a full day or anything, but he, we al…
Neil and Seth on the Science of Family Guy | StarTalk
Seth, I called you into my office. Yes, I got to talk to you. Want me to help you clean up? Clean up the office? At some point, I had to find you and talk to you about the science in Family Guy. Yeah, yeah, and I said to myself before I even met you, the…