Issue
How can I check weather or not the value after the decimal of an integer is a zero
a = 17.3678
if a???:
print("the value after the decimal point is zero")
else:
print("the value after the decimal point is not zero")
Solution
You can use the split method:
a = 17.3678
a = str(a)
valueAfterPoint = a.split('.')[1]
valueAfterPoint = int(valueAfterPoint)
if valueAfterPoint == 0:
print("the value after the decimal point is zero")
else:
print("the value after the decimal point is not zero")
Answered By - Tom Answer Checked By - Willingham (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.