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
RC natural response derivation (2 of 3)
Now what I want to do for the RC circuit is a formal derivation of exactly what these two curves look like, and then we’ll have a precise definition of the natural response. Okay, what I want to do now is real quick draw our circuit again. There’s R, the…
Internet Safety Course Introduction
Hi everyone. Sal Khan here from Khan Academy, and I just wanted to welcome you to this course on internet safety. Now, you might be saying, “Why should I look at this course? The internet seems like this fun and fabulous place where I can interact with …
How To Get A PERFECT Credit Score For $0
What’s up guys, it’s Graham here! So it finally happened, and we are celebrating today because for the last nine years, my credit score has never once surpassed the legendary eight hundred score. I got it once to seven ninety-nine, but it was just never a…
How Pharaohs Projected Divine Power | Lost Treasures of Egypt
These iconic monuments are just shouting, screaming at us: power, dominance, control. I feel about this; I feel so insignificant. Together, these pyramids and the Sphinx and the temples create a landscape of [Music] power. The huge sculpture protects the …
How To Beat The Stock Market In 2019
What’s up you guys? It’s Graham here. So, I think it’s undeniable that we’ve seen a lot of recent discussion lately about the current state of our economy, talking about this upcoming looming recession and what to do when the stock market drops in price.…
Worked example: analyzing an ocean food web | Middle school biology | Khan Academy
So this diagram right over here describes a food web, and a food web models how energy and matter move in an ecosystem. We’re going to use this food web to answer some questions to make sure we understand food webs. So the first thing I’m going to ask yo…