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
How to Find a Cofounder - Kat Manalac
Hi, I’m Cat Mini Alec, and I’m a partner at Y Combinator. I’ve been at YC for five years now, and I’ve seen about 1,300 companies go through the program. Today, I’m going to answer the question: how do I meet a co-founder? First, I’m going to talk about …
Neutron Star Merger Gravitational Waves and Gamma Rays
Due to the crazy technological challenges that had to be overcome in order to detect gravitational waves, some people were skeptical that scientists had actually done it, that they’d actually seen gravitational waves from black holes - after all, there wa…
Laplacian computation example
In the last video, I started introducing the intuition for the Laplacian operator in the context of the function with this graph and with the gradient field pictured below it, and here I’d like to go through the computation involved in that. So, the func…
Becoming a founding engineer at a YC startup
[Music] Everyone, thanks for joining. I’m Paige from Y Combinator on our work at a startup team. Um, that’s the site that our portfolio companies use to hire people and the site that candidates can go to get jobs at YC startups. With us today, we have thr…
The Most Powerful Mindset for Success
There is a psychological trait that all successful people appear to have in common. It’s been cosigned by Bill Gates and NASA uses it as a criteria for selecting potential Systems Engineers. This concept is called the growth mindset, a term originally coi…
Simulating a beehive with for loops | Intro to CS - Python | Khan Academy
Let’s design a simulation with for loops. We want to answer the question: How much honey does a beehive produce over a certain period of time? Now, there are a lot of variables that might impact honey production, like the geography, the weather, and what…