Display float values from list

numbers = [1,1.3,3,4,5.5,6.5,8.9,99]

for n in numbers:

    if type(n) == float:
        print(n)

Output

1.3
5.5
6.5
8.9

 

Published by Python programming examples for beginners

Abhay Gadkari is an IT professional having around experience of 20+ years in IT industry. He worked on web technologies and databases with Insurance and ERP projects.