How do we deal with questions including two lines in the input? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How do we deal with questions including two lines in the input?

Task: two prices in Pesos and in Dollars, tell which one is smaller. Coversion rate is dollar = pesso*0.02 Example: Input: 400 10 My code is the following. This doesent seem to work def price(peso, dollar): convert = peso* 0.02 if convert <= dollar: return('Pesos') else: return('Dollars')

12th Apr 2020, 3:03 PM
Yasir Mahmood
Yasir Mahmood - avatar
4 Answers
+ 1
peso = int(input()) dollar = int(input()) And if I am correct you need to print Dollars when peso == dolar.
12th Apr 2020, 3:08 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
do u mean peso = input() dollar = input() price(peso,dollar)
12th Apr 2020, 3:09 PM
durian
durian - avatar
+ 1
Woww.. You people are great Thanks, it was simple but I missed.
12th Apr 2020, 3:26 PM
Yasir Mahmood
Yasir Mahmood - avatar
0
The values of pesos and dollars are integer. peso = input() -> peso would be a string.
12th Apr 2020, 3:11 PM
Denise Roßberg
Denise Roßberg - avatar