0
code is for finding the last digit of float but it can't do its job so please help
3 Respostas
+ 1
Your code is almost working. The problem is if you do substraction to the last digit. Both side are equaled and the result will be zero afterwards. You have to avoid substraction at the last digit.
+ 1
Input your float value as string and print str[len(str)-1]
+ 1
f = 9.45678
print(str(f)[-1])
#prints 8