- 1

Why does it come up with 12525 rather than 25?

bill = int(input(125)) (bill*20/100)

28th Sep 2021, 6:48 AM
Oliver Brown
4 odpowiedzi
+ 3
bill = int(input())
28th Sep 2021, 6:50 AM
Simba
Simba - avatar
+ 2
input() takes parameters of what should be printed to console before getting user input. So basically your code first prints "125" Then gets input, makes calculations and outputs "25.0" So you end up with "12525.0" To fix that just remove "125" from input() function arguments. bill = int(input()) (bill*20/100)
28th Sep 2021, 6:53 AM
Aleksei Radchenkov
Aleksei Radchenkov - avatar
+ 1
Oliver Brown Use print() function to output: bill = int(input()) print(bill*20/100)
28th Sep 2021, 6:58 AM
Aleksei Radchenkov
Aleksei Radchenkov - avatar
0
Thanks,but it doesn't complete the lesson because I get no output.
28th Sep 2021, 6:56 AM
Oliver Brown