From the course: Python Theory for Network Engineers
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Python numbers and math - Python Tutorial
From the course: Python Theory for Network Engineers
Python numbers and math
- [Instructor] When it comes to numerics, the two main types or data types are int and float. So they're, let's say, int and float. For numbers that does not have a decimal point, we could use int. Otherwise we use float. And we could have a variable again to assign and have the values of int, for example. So if I do age 65 and I do a type and age. I could see that this is an int. But if I say age 65.0 and if I do a type, you could see that's a float because you could represent numbers with decimal points and carry out a larger representation of this number, as well. So let me go ahead and represent age back into 65, because it's kind of weird to have an age with a decimal point. I suppose you could, but, you know, I guess it's a little bit weird. And we could also convert between the two, right? So my number, I could say my_num equals to 10, and if I do a type, you could see my_num is a int, but if I do a float,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Python data types5m 46s
-
(Locked)
Strings and string methods6m 47s
-
(Locked)
Python numbers and math6m 29s
-
(Locked)
Python collections: Tuples, lists, and dictionaries9m 2s
-
(Locked)
Python superpower: Imports4m 16s
-
(Locked)
Challenge: Getting information from network gears8m 41s
-
(Locked)
Solution: Getting Information from network gears7m 24s
-
-
-
-
-