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
Introduction to negative numbers
In this video, we’re going to introduce ourselves to the idea of negative numbers. Now, you’re already used to the idea of positive numbers; you just called them numbers, not positive numbers. And just to give you an example, I will draw a number line her…
8 Animal Misconceptions Rundown
8) Let’s talk about Lemmings. When you hear the word “lemmings,” you might think of two things: this video game and some sort of small creature that suicidally leaps off cliffs when its population grows too large. In case you didn’t know, lemmings are rea…
Breakthrough Prize Ceremony Live
The human mind is an incredible thing that can conceive of the magnificence of the heavens and the intricacies of the basic components of matter. Yet for each mind to achieve its full potential, it needs a spark—the spark of enquiry and wonder. I don’t be…
WHAT JUST HAPPENED WITH YOUR STIMULUS CHECK
What’s up, Graham? It’s guys here, so I’m sure we all know this saying: whatever can happen will happen. As much as we thought it was a sure thing that the Senate would pass some sort of stimulus package before they left for recess on August 7th, they wer…
Models of citizenship | Citizenship | High school civics | Khan Academy
What do you think it means to be a good citizen? What does a good citizen do? Take a minute to imagine your idea of a good citizen. What characteristics does that person have? What actions does that person take that contribute to their status as an active…
2012 Berkshire Hathaway Annual Meeting (Full Version)
[Applause] Good morning! I’m More and then this hyperkinetic fellow is Charlie. We’re going to, uh, conduct this pretty much as we have in the past. We’ll take your questions, alternating among the media and analysts in the audience until 3:30, with a br…