Answer:
- def getLargest(number_list):
- new_list = []
-
- for x in number_list:
- if(isinstance(x, int)):
- new_list.append(x)
-
- largest = max(new_list)
-
- return largest
Step-by-step explanation:
Firstly, create a function getLargest() that take one input parameter, number_list.
The function will filter out the float type number from the list by using isinstance() method (Line 5). This method will check if a current x value is an integer. If so, the x value will be added to new_list.
Next, use Python built-in max function to get the largest integer from the new_list and return it as output.