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
Khan Academy’s 100&Change proposal: World-class diplomas for anyone, anywhere
Hi, I’m Sal Khan, founder of the Khan Academy. We’re a not-for-profit with a mission of providing a free, world-class education for anyone, anywhere. There are tens of millions of people learning on Khan Academy who want to prove what they know, who want…
how to learn a language on your own | study tips 📚🌎
Hi guys, what’s up? It’s me, Dudy. Today, we’re gonna talk about how to learn any language on your own, and I’m gonna give you some study tips and also the methods that I’m gonna use for learning Italian because I moved to Italy and I don’t know Italian …
The Strange and Wonderful World of the 'Snail Wrangler' | Short Film Showcase
I always like to ask my audience, when you think about land snails, what’s the very first word that pops into your head? Just one word. Hello? Yes, what else? Slimy? What else? Holes in your knees? So, damage to your garden. A little more background on …
Photon Momentum | Quantum physics | Physics | Khan Academy
[Music] A while back I was teaching physics in California. I got to class and I was all like, “Hey class, you want to hear a physics joke?” “Yeah, okay totally!” “Does light hold mass?” “I don’t know, does it?” “No, it’s not even Catholic!” Oh man, …
Anti-Gravity Wheel?
I am here at the University of Sydney where the mechanical engineering shop has built this incredible piece of apparatus for me. It is a forty pound, that is nineteen kilogram flywheel on the end of a meter long shaft. Can you imagine trying to hold this …
Command and market economies | Basic economics concepts | AP Macroeconomics | Khan Academy
In this video, we’re going to talk about different ways of structuring an economy. In particular, who owns what and how does an economy decide what to produce and who gets the output of that production. So, on one side, you have what’s known as a command…