Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
peso = int(input()) dollar = int(input()) peso_d = peso*50 if peso_d > dollar: print("Dollars") else : print("Pesos") Try this code once if you want to divide you must divide peso by 50 not 20.
26th Jun 2022, 6:22 PM
Satyam Mishra
Satyam Mishra - avatar
+ 1
It isn't quite clear to me why you use floor division and then convert it to float again but you need to remove the additional space in the Dollars output.
26th Jun 2022, 5:36 PM
Lisa
Lisa - avatar
+ 1
Yeah she is correct, this should work. amt = int(input()) dollar = int(input()) peso = amt/ 20 or dollar = amt*50 if peso >= dollar: print("Dollars") else : print("Pesos") But instead of dividing dollar with 20, you can also multiple amt with 50 and then compare. It should work all same.
26th Jun 2022, 5:54 PM
Satyam Mishra
Satyam Mishra - avatar
+ 1
You haven't used amt. I think it should be peso = amt/20?
26th Jun 2022, 6:06 PM
Lisa
Lisa - avatar
+ 1
Oh, I missed that part: it's 2 cents, some maybe it gets clearer if you put it peso = amt * 0.02
26th Jun 2022, 6:37 PM
Lisa
Lisa - avatar