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
We Got Us a Goat | The Boonies
[Music] You’re a little bigger. I put a saddle on you, make this trip a lot easier. In Onion Creek, Washington, DOC Leverett has successfully bartered for a lamancha bear goat, the kind of renewable food source he needs to sustain his life above the grid…
Example: Comparing distributions | AP Statistics | Khan Academy
What we’re going to do in this video is start to compare distributions. So for example, here we have two distributions that show the various temperatures different cities get during the month of January. This is the distribution for Portland; for example,…
5 Millionaire HABITS You Can COPY FOR SUCCESS | Kevin O'Leary
Hi there. As is usually the case, this week’s episode of Ask Mr. Wonderful was inspired by a question. This one from Zoe—really intriguing, loved that name by the way. Zoe writes, “I watched your Ask Mr. Wonderful episode when you explained how you made …
AMA with Sal Khan on AI + Education
But for now, I want to kick things off with a question that Aaron had asked in the Q&A and got a lot of upvotes, and that was: what role do you envision generative AI having in education beyond just AI-enabled software and apps, as it pertains to the …
Bitcoin For The Intelligent Layperson. Part One: Context.
[Music] In 2008, an anonymous person going by the name Satoshi Nakamoto wrote a paper describing a protocol for a digital currency called Bitcoin. Bitcoin brought together ideas discussed on the cipherpunk mailing list during the 1990s. The cipherpunks st…
For parents: Setting a daily learning schedule for elementary school students
All right, hi everyone! Thank you so much for joining our parent webinar on how to create a schedule for your third through fifth-grade student, as well as how you can use Khan Academy resources and tools to support your child’s learning at home. So you c…