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
Wealth and Happiness: How to Achieve Both
They lied to you. Since you were a child, you kept hearing it over and over and over again. You always have to make a choice: money or happiness. You simply can’t have both. But what if we told you that’s just a coping mechanism for poor and middle-class …
Apostrophes and plurals | The Apostrophe | Punctuation | Khan Academy
Hello grammarians! Hello David! Hello Paige! So today we’re going to talk about apostrophes and plurals. We talked about this a little bit in our introduction to the apostrophe video. This is a very, very rare case where we use an apostrophe to show that…
The 2022 Recession: How To Prepare For The Next Market Crash
So over the past few years, we’ve been through a lot of hardship. No doubt it’s been pretty tough, so tough that the Federal Reserve has stepped in to wind up that money printer to help individuals and businesses get through such an uncertain and interrup…
Writing a quadratic when given the vertex and another point | Algebra 1 (TX TEKS) | Khan Academy
We’re told a quadratic function f has a vertex at (-4, 7) and passes through the point (-2, -5). Write an equation for f in vertex form. So pause this video and try to work that out before we do that together. All right, so first let’s think about the ge…
ROBINHOOD LOOPHOLE GIVES YOU INFINITE MONEY
Before I start this video, I want to make a very serious disclaimer. The purpose of this video is to describe a newsworthy event, the issues surrounding it, why it’s a bad idea to engage in this type of behavior, and bring to light a very serious issue so…
15 Things That Change Once You Get Rich
You know, some people say that money can’t change them, and even if that might be true, money does change the things around you. These are 15 things that change once you get rich. Welcome to Alux, the place where future billionaires come to get inspired. …