0
Python code not validating number
1==1 returned false #you input something that ends in 11111 z=input() print(z[-1],'cnp') v=1 print(v,'rest') if z[-1] == v: print('yes') else: print('nono')
2 odpowiedzi
0
z[-1] is character
v is a number so it teturn false
try
if int( z[-1]) == v :
else take v = '1'
0
Solved it just now
i did
b=z[-1]
if int(b)==v:
print ('yyy')
else:
print('nnn')
I needed it to be int