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
I Fed a Chameleon From My Mouth To Study Its Mouth ( In Slow Motion) | Smarter Every Day 180
Hey, it’s me Destin, welcome back to Smarter Every Day. I’ve been wanting to do this video forever. Chameleons’ tongues are very unique, and this is a very hungry chameleon right now, and I’m going to see if I can feed him by holding a cricket in my mouth…
Ponzi Factor | SEC Meeting 1
Hi everyone, this is Thanh. A quick note, kind of exciting news! I am in the process, as in either this morning or next hour or so, I’m gonna go into a roundtable meeting with the chairman of the ICC, J. Clayton, and also some other senior officials of th…
Colonizing Mars | StarTalk
So let’s go piece by piece. One-way mission with people who would just agree to go one way, and he sends supplies in advance. There’s going to set up Hab modules. I’ve got an image of what his Hab modules would look like on Mars. I think we can put it up …
Democratic ideals of US government
What we’re going to do in this video is discuss some of the foundational ideas for the United States of America. We could start at the most foundational of ideas, and that’s the notion of natural rights. John Locke, one of the significant Enlightenment th…
Writing whole numbers as fractions
We’re told that each rectangle is a hole, so this is a hole right over there. That’s one hole, and so this is two holes. Which expressions describe the shaded part of the picture? They’ve shaded in everything and they say, “Choose to answer.” So pause th…
What I Wish I Knew When I Was Younger
Welcome to beautiful Vancouver, British Columbia. This is actually where I grew up, just across that water. And I remember when I was a teenager here I wanted to be a film maker. And so what did I do? Well, I found a film director with a strange name who …