From the course: Python for Students (2019)

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Numbers and basic calculations

Numbers and basic calculations - Python Tutorial

From the course: Python for Students (2019)

Numbers and basic calculations

- [Instructor] If you think about the things we use computers for, numbers are front and center. Whether it's counting the number of likes on a YouTube video, keeping score on a video game, or viewing your account balance in your bank account. In fact, one of the reasons the modern computer was invented was to do a large number of calculations quickly. It shouldn't surprise you, then, that Python is really good at working with numbers. Let's go ahead and play around with some numbers using the Python Shell in IDLE. The first type of number we'll work with is called an integer. An integer is just a number that doesn't have a decimal point. So for example, one, 10, really any number arbitrarily big, Python can support it. You can also do basic calculations, such as addition, subtraction, multiplication, and division. Notice that when we divided three by two, we ended up with a number that had a decimal place. In…

Contents