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
What Jumping Spiders Teach Us About Color
You are not looking at a yellow ball. Your brain might think you’re looking at a yellow ball, but look closer. The screen you’re watching this on displays color using only red, green, and blue subpixels. The yellow your brain thinks it’s seeing is actuall…
Lateral & total surface area of cylinders | Grade 8 (TX) | Khan Academy
We’re told the dimensions of a cylinder are shown in the diagram. Fair enough! What is the lateral surface area of the cylinder, and what is the total surface area of the cylinder? Pause this video and have a go at this before we do this together. All ri…
Michael Seibel - How to Plan an MVP
My name is Michael. Uh, I work here at Y Combinator. I helped run the accelerator. Uh, before that, I did two YC startups—one in 2007 and one in 2012. Today, I’m going to talk to you about a minimum viable product, so MVP. We always yell at founders to n…
What Successful Founders Focus On - Dalton Caldwell
One of the things that I’ve seen very successful founders and lucky founders focus on is their product, customers, revenue, their team, and not really focus on all of the noise in the startup ecosystem. Specifically, there’s a great deal of press every da…
#shorts
Here’s a day in the life of a private jet broker. I arrived at the office at 7:00 a.m. to respond to some important emails from Hong Kong and Dubai, ensuring they were received within their working hours. Being on time builds trust and keeps things runni…
States of Matter
So I wanted to talk to people about the different states of matter: solid, liquid, and gas, using water as an example. But I thought first I better be sure that we’re all on the same page about what water is made of. What’s water made of? Water? Yeah, wha…