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
The Book Bush Was Reading on 9/11
I’m often asked why I have this book. Well, this book is a piece of American History. It is the book that George W. Bush was reading when 9⁄11 happened. That morning, he was at M. E. Booker Elementary School in Sarasota, Florida, following along as studen…
World's Longest Straw
Hey Nige, can you get me another coke? Nah, I’m good, thanks. It’s just downstairs. Nah, the tennis is on. You come to my house to watch the tennis and you’re not even going to get me another coke? Yeah, it’s the tiebreaker. Relax. You know what I …
We fund smart founders, irrespective of what they want to work on.
What’s the percentage of companies you’ve backed right now that have large language models? I think for Summer ‘23 it was close to 50% of the batch. And it’s pretty interesting! Like, I think a lot of people see that number and they think, “Oh, YC must h…
My Life As an Adventure Filmmaker and Photographer (Part 2) | Nat Geo Live
Like any budding photographer, you know I was, of course, I got National Geographic magazine. That’s sort of the standard in photography. I remember when this issue came in the mail; it was called “Storming the Tower.” I read the story, and it was about f…
Monopolies vs. perfect competition | Microeconomics | Khan Academy
In this video, we’re going to dig a little bit into the idea of what it means to be a monopoly. To help us appreciate that, let’s think about the spectrum on which firms can be. This is going to be my spectrum right over here. Now, at the left end, we ca…
Beginnings of Islam part 2
Where we left off in the last video, we saw Muhammad being born into a tribal Arabia. He’s born into a powerful tribe, the Quraish, who are in control of Mecca. But his early life is difficult. His mother dies when he’s six; his grandfather, who’s taken c…