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
Teach Elementary with Khanmigo
Hi, I’m Michelle, a professional learning specialist here at Khan Academy and a former classroom teacher just like you. I’d like to introduce you to Kigo, your AI-driven companion who’s revolutionizing teaching for a more engaging and efficient experience…
Should Retail Investors Buy The Dip? | Crypto World
[Applause] [Music] Kevin, you said that 20% of your investments are in crypto. So I just want to start with, what are you doing? Are you exiting some of these positions or are you buying more? No, I’m actually averaging down on a couple of the big marke…
Connotation | Reading | Khan Academy
[David] Hello, readers. Today, let’s talk about feelings. Specifically, the way the words make us feel. That’s right, I’m talking about connotation. The way the word feels, the context around it. Imagine a rock in a stream. Well, connotation is the way th…
Animation: How Three Men You Probably Never Heard of Helped End WWII | Short Film Showcase
[Music] Dawn, 30th of October 1942. A periscope and the outline of a submarine are spotted by a Royal Air Force patrol aircraft in the Eastern [Music] Mediterranean. This sighting will be a vital turning point at Bletchley Park. For 10 devastating months,…
Evaluating a source’s reasoning and evidence | Reading | Khan Academy
Hello readers. How do we know what is true and what isn’t? My mama always told me, “Don’t believe everything you read.” Just because someone took the time to write something down, send it off to be typeset, designed, and printed in a book, or published on…
Proportional reasoning with motion | AP Physics 1 | Khan Academy
NASA is researching how to send humans to Mars by as early as 2030. Now this is a complex mission because you’re traveling for millions of kilometers, and this will involve a lot of things. We have to think about how much fuel we need, how much oxygen we …