python remove 0

Solutions on MaxInterview for python remove 0 by the best coders in the world

showing results for - "python remove 0"
Rafael
12 May 2020
1number = 5.0
2number = int(number)
3# 5
4
5# Safety net if number is not equal to int
6def safe_int(number: float):
7	if number - int(number) == 0:
8    	return int(number)