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")

2nd Dec 2023, 7:12 PM
Mau
4 Respostas
+ 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.
3rd Dec 2023, 4:39 PM
Lothar
+ 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")
2nd Dec 2023, 7:42 PM
JaScript
+ 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.")
3rd Dec 2023, 4:16 AM
Rain
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( ) --------------^
2nd Dec 2023, 9:23 PM
Med Yassine