Numeric types include integers and floating point. Use the decimal module for fixed-point arithmetic when working with financial applications.
- [Instructor] Python 3 has two basic numeric types,…integer and floating point.…There are other types derived from these including the…built in complex type.…In fact, because everything is an object in Python,…you can derive your own types.…Here we're going to talk about integer and float.…Here in Komodo, I've opened a working copy of types.py…from chapter three of the exercise files.…And you notice down here on line four,…x equals seven, and seven is an integer.…
So if I save this and run it you see it says class int.…And if I multiply this by three,…save and run,…we now have a value of 21 and it's still a class int.…So it's an integer.…On the other hand if I say seven point zero.…And save and run it,…we now have class float, which is a floating point number.…Or, if I say seven times…three point one four one five nine,…I save this and run it,…we now have a floating point value because we used a…floating point number in our calculation.…
On the other hand, if I divide two integers,…say seven divided by three,…when I save and run this, I have a floating point number…
- Python anatomy
- Types and values
- Conditionals and operators
- Building loops
- Defining functions
- Python data structures: lists, tuples, sets, and more
- Creating classes
- Handling exceptions
- Working with strings
- File input/output (I/O)
- Creating modules
- Integrating a database with Python db-api
Skill Level Intermediate
Python: Programming Efficientlywith Michele Vallisneri2h 15m Intermediate
2. Language Overview
3. Types and Values
8. Structured Data
11. String Objects
12. File I/O
13. Built-in Functions
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.