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
Static electricity | Physics | Khan Academy
One of my favorite things to do with a balloon is to rub it on my wife’s hair because it makes the hair stick to the balloon. Isn’t that pretty cool? Why does it happen? And now, if I bring the balloon close to a few pieces of paper, look! The pieces of p…
MANTIS MURDER SHRIMP (Slow Motion) - Smarter Every Day 121
Yeah. Hey it’s me Destin, welcome back to Smarter Every Day. So I’ve seen enough videos on the internet of a mantis shrimp punching to have a good idea of what’s going on, but I don’t understand it, like at the mechanical level. So today on Smarter Ever…
Balaji Srinivasan at Startup School 2013
I can talk about white combinator. I guess you guys all know about that. Uh, let me introduce myself briefly while, uh, things are loading here. So, uh, my name is Bology S. Boson. Um, there’s actually 12 people with my same first and last name in the Bay…
After PMF: People, Customers, Sales by Mathilde Collin
Following on from Paul’s talk about some of the ways to think about becoming, or what it takes to become, or whether you might believe you might become a hundred billion dollar business, I am going to have a conversation with Mathilde, who is in the proce…
Amelia's Turkey Tail Tea | Live Free or Die: How to Homestead
Either these are turkey tail mushrooms. So, turkey tail is one of our favorites. They are easy to identify. Pick a piece and look on the underside; if the underside has pores in it, which are lots and lots of teeny tiny holes, then it’s turkey tail. The t…
Shifting functions introduction | Transformations of functions | Algebra 2 | Khan Academy
So I am here at desmos.com, which is an online graphing calculator. The goal of this video is to explore how shifts in functions happen. How do things shift to the right or left? Or how do they shift up and down? What we’re going to start off doing is ju…