I’m trying the following, but it always returns output a = input x, even if a = 0. I am working with integers and the type hint for x is set as such.
if x == 0:
a = 1
else:
a = x
print a
Covering tutorials and posts I also tried a different approach in the attached images, but it is not producing the desired result.
Any help is appreciated!
It could be something funky with the implementation (maybe you had a phantom variable, remember to attach your example file). Anywho, this seems to work as expected: