From the course: Python Functions for Data Science
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Python type() function - Python Tutorial
From the course: Python Functions for Data Science
Python type() function
- [Instructor] Another fundamental built-in function that comes in handy when working with data in Python is type. The function type takes in an object as input and returns the data type of a given object. To show you how the function type is used, I'll be working through some examples. Let's say I have a variable named listF. To find the type of this variable, I can call the function type and pass in listF, it will look like this. There, listF has the type list. Next, say that I have a variable named nums. To find the type of this variable, I can call the function type and pass in nums, it will look like this. I run the cell now, there we go. Nums has the type tuple, then I have a variable named names. To find the type of this variable, I can call the function type and pass in names, It will look like this. Now I run the cell. As you can see, names has the type set. Next up, I have a variable named exercise. To…
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 print() function2m 30s
-
(Locked)
Python input() function2m 1s
-
(Locked)
Python abs() function1m 57s
-
(Locked)
Python round() function2m 10s
-
(Locked)
Python min() function1m 42s
-
(Locked)
Python max() function1m 41s
-
(Locked)
Python sorted() function3m 39s
-
(Locked)
Python sum() function1m 1s
-
(Locked)
Python len() function2m 28s
-
(Locked)
Python type() function2m 22s
-
-
-
-
-
-
-
-