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
Inflection points (graphical) | AP Calculus AB | Khan Academy
We’re told let G be a differentiable function defined over the closed interval from 4 to 4. The graph of G is given right over here, given below. How many inflection points does the graph of G have? So let’s just remind ourselves what are inflection poin…
Ken Griffin: From Starting a Hedge Fund in His Dorm Room to Billionaire Investor
Which brings me to a quote that describes the ethos of Citadel: “Things may come to those who wait, but only those things left by those who hustle.” Now, here’s what I really love about this quote. Who said this? I went off to Harvard to study economics…
I Got Covid
So as you can see from the title, I got COVID. Initially, I held back from talking about this since, one, I wanted to make sure I wasn’t experiencing any long-lasting side effects before sharing my own experience, and two, I was nervous because I guess th…
Centripetal force | Physics | Khan Academy
You may have seen astronauts floating in the space station. Is it because there’s no gravity? No, there is gravity because it’s very close to Earth. Then why are they floating? Well, turns out that they are not floating. In fact, the whole space station i…
Why YOU Need To Invest in PSYCHEDELICS | Ask Mr. Wonderful #14 Kevin O'Leary
[Music] All right everybody, back for another episode of “Ask Mr. Wonderful.” Here today with my recently acquired 1969 Telecaster. Telecasters are very unforgiving guitars. Not that I want to get sidetracked here, but I just thought maybe a couple of lit…
15 Things to Avoid If You Want to Grow
Growing and evolving in life is a wonderful journey that we all want to experience, right? It’s a bit like planting a tiny seed and then caring for it so it can grow into a strong, magnificent tree. But as we move forward, there are some catches that we s…