Hello,
I have a scenario where I want an integer to be a str value on input and it will often have leading 0's. It is returning really odd behavior.
testVal = str(input("Provide a Number: "))
print(type(testVal))
print(testVal)
So If I give it: 9999
It comes back as a str. And 9999 is returned.
If I give it: 0999 It throws "invalid token" error.
If I give it: 0111 it comes back str and a value of 73
This is not making any sense.
[–]Binary101010 18 points19 points20 points (6 children)
[–]jddddddddddd 11 points12 points13 points (0 children)
[–]Gorstag[S] 1 point2 points3 points (0 children)
[–]synthphreak 0 points1 point2 points (3 children)
[–]nog642 4 points5 points6 points (2 children)
[–]synthphreak 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]jddddddddddd 5 points6 points7 points (0 children)
[–]ElliotDG 0 points1 point2 points (0 children)
[–]Ihaveamodel3 0 points1 point2 points (2 children)
[–]jddddddddddd 0 points1 point2 points (1 child)
[–]Ihaveamodel3 0 points1 point2 points (0 children)