0
What Is wrong with my Python code? If you know tell me
z=int(input()) y=int(4) x=int(z/y) if x==int(): print("oi") else: print("lo")
4 ответов
+ 3
Mau ,
since people do not have all required information, they start guessing (which means waisting time).
> a clear description is needed from you.
> please also create samples with input and output values.
+ 1
# I don‘t know what you want to do but this way will be better:
z=int(input())
y=4
x=int(z/y)
if x==int(input()):
print("oi")
else:
print("lo")
+ 1
Mau ,
Are you trying to find out if the input is evenly divisible by 4? This would work.
z = int(input())
y = int(4)
x = int(z/y)
if x == int(x):
print("oi") # divisible
else:
print("lo") # not divisible
Or, shorter, this.
z = int(input())
if z % 4: # remainder is non-zero
print(z, "is not divisible by 4.")
else: # remainder is zero
print(z, "is divisible by 4.")
0
i dont know what's this
but
u can change int(z/y) by z//y
and u need to put something inside the int() function in
if x==int( )
--------------^