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
Time dilation | Special relativity | Physics | Khan Academy
[Voiceover] So let’s revisit a scenario that we have seen in several videos, especially the last video, where we tried to find this neutral frame of reference. Let’s say we’re in spaceship A. We are in an inertial frame of reference. And let’s say right…
Inside the Illegal Ape Trade | Trafficked: Underworlds with Mariana van Zeller
I’m Mariana Vanel, as a journalist covering the underworld. I’ve seen almost everything that can be trafficked, but apes was a really sad and difficult story to report on. Wildlife trafficking is the fourth most lucrative crime in the world; we are talkin…
How To Work On A Long Term Plan (Without Having One)
There are many people who want to work toward a long-term goal, but they just don’t have one. They don’t know what they’ll be doing in the next five or ten years. They don’t know what life has in store for them. Maybe they’ll be in a different town with a…
Recognizing fragments | Syntax | Khan Academy
Hello grammarians! David here along with my cousin Beth, who also happens to be a teacher. Say hello to the people, Beth. “Hi, people!” So today we are going to talk about sentence fragments. Beth, you cover these in classes that you teach. Could you te…
Kirchhoff's voltage law | Circuit analysis | Electrical engineering | Khan Academy
Now we’re ready to start hooking up our components into circuits, and one of the two things that are going to be very useful to us are Kof’s laws. In this video, we’re going to talk about Kof’s voltage law. If we look at this circuit here, this is a volt…
Nietzsche - How to Become Who You Are
For Nietzsche, becoming who you are leads to greatness. And in Ecce Homo, he wrote, “[that] one becomes what one is presupposes that one does not have the remotest idea what one is.” The question of how you become what you are begins with the idea that yo…