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
A New History for Humanity – The Human Era
Humans have existed for millions of years, as part of nature. But then, something changed. And in an incredibly short amount of time, we terraformed this planet and designed it to fit our needs. As far as we know, we’re the first beings to awaken and comp…
Lagrange multiplier example, part 1
So let’s say you’re running some kind of company, and you guys produce widgets. You produce some little trinket that people enjoy buying. The main costs that you have are labor—you know, the workers that you have creating these—and steel. Let’s just say …
This Man’s Words Will Make You Appreciate the Beauty of Life | Short Film Showcase
[Music] How amazing is this stay, the spiders webcast? Its shadow play lies, sing in sprays. Redwoods and broad oaks hold sway, rip berries for beaks and lips. Patches of white lace all set on this delicate plate. We at your table, but [Music]. Guess I’v…
The Dark Secrets of the Manhattan Project
In 1946, a 41-year-old hairdresser named Janice Shot came to A Strong Memorial Hospital in Rochester, New York, to be treated for scleroderma. It were a connective tissue condition. She had escaped the violence against Jews in Belarus during the Second Wo…
Creative biology at work | High school biology | Khan Academy
[Music] Hi everyone, Salcon here. From finding novel cures for a seemingly incurable disease to diagnosing what’s going on with someone, if you’re a physician or a nurse, you can imagine there’s incredible creativity in biology. And don’t take my word fo…
The fastest private jet deal I have done
One of my most memorable quickest deals was actually getting a phone call from somebody saying he wanted to buy a certain airplane. I told him that the airplane was really just ready to be under the contract. He said he wanted to buy something immediately…