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
Ethical Rudeness | The Philosophy of Mencius
We live in an age in which freedom of speech and saying what we want is seen as one of the most important tries of human being. But does that make rudeness a virtue? While I think that people should have freedom of speech and that unpopular opinions shou…
Surviving Black Hawk Down | No Man Left Behind
You know, the survivor aspect is a hard one to pin down. I think some of us have it in our DNA. I don’t think we’re all the same. I don’t think we all react the same to stress. I don’t think we all react the same to adversity. I don’t think we all react t…
Elon Musk Giving 1,000,000 Every Day Until Election!
Uh, we are going to be awarding a million every day from now until the election. The world’s richest man just chucking millions of dollars at people to register to vote. What did you think? Well, again, for full transparency and disclosure, my son works …
Intelligent Species Have Only Risen Once on Planet Earth
Now that’s one argument, and we have to be humble in the face of uncertainty. Here, no one knows. But I want to give an argument that rarely gets any air time. The argument is that we are alone, and the argument has nothing to do with astronomy; it has ev…
Business Lessons From Ancient Japan
Did you know that the five oldest companies still operating today in the world were all founded in Japan more than one thousand years ago? There’s even a Japanese term for businesses that have survived more than a century, kept ownership within the same f…
Everything About Grain Bins (Farmers are Geniuses) - Smarter Every Day 218
Holy cow, there’s a lot going on here! Hey, it’s me, Destin. Welcome back to Smarter Everyday. When you eat today, that’s food going to get to your plate from a field like this, and before it gets in that field, it’s going to pass through the hand and the…