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
Theoretical probability distribution example: tables | Probability & combinatorics
We’re told that a board game has players roll two three-sided dice. These exist, and actually, I looked it up; they do exist and they’re actually fascinating! And subtract the numbers showing on the faces. The game only looks at non-negative differences. …
Safari Live - Day 31 | National Geographic
[Music] This program features live coverage of an African safari and may include animal kills and carcasses. Viewer discretion is advised. Dry-season day. This is Safari Life, standing by. [Music] Good afternoon and welcome to our sunset safari on this …
Why are bugs attracted to light? - Smarter Every Day 103
Hey, it’s me Destin. Welcome back to Smarter Every Day. So you’ve noticed that moths and other bugs sometimes get trapped around a light. Have you ever thought about why? [music] We are in the middle of the Amazon rainforest and we have a huge mercury vap…
Inflation Just Hit a 13-Year High and Investors Are Worried
So in the past week, the Federal Reserve has had their little meeting and decided to keep interest rates exactly where they are until their next meeting. So for those that don’t know, the Fed meets eight times per year to discuss monetary policy. With in…
Aloneness vs. Loneliness | What's The Difference?
At the end of the day, loneliness is just a mindset. I won’t deny that it can be difficult to get rid of feelings of loneliness because the desire for companionship is deeply ingrained in human nature. However, this doesn’t mean that we have to suffer whe…
Meth Smuggling Model | Locked Up Abroad
At that point in time, my main mission was to get it back to Australia. We bought a whole heap of crystal meth from Zack’s suppliers—big snaplock bags of drugs. So, we bought a whole heap of gift sets that had bath salts in them. There was a process; we w…