+ 1

what is the problem withthis code

def a(x,y): s=str(x) r='' ind=len(s) while ind>0: r+=s[ind-1] ind-=1 q=print(r[0]) d=str(y) w='' ind1=len(d) while ind1>0: w+=d[ind1-1] ind1-=1 e=print(w[0]) if r>w: print(x) elif r<w: print(y) x=int(input('enter first number ')) y=int(input('enter second number ')) print(a(x,y)) i want to check the highest one'place digit only

28th Jun 2019, 5:21 PM
Shivam Sharma
1 Resposta
+ 1
You'll see some numbers being printed. That's due to "q = print(r[0])" and "e = print(w[0])". if r > w: return x else: return y
28th Jun 2019, 6:34 PM
Diego
Diego - avatar