0
Why the output (is 555 when ip is 5) in playground
s = input("Enter amount please: ") print(s) print ('new payment will be: ') y=s+(s*2) print (y)
6 ответов
+ 7
You are basically adding string to string
So if someone enters 450
It's "450"+("450"*2)
which is 450450450
Remember input returns string you need to convert the input to int explicitly
int(input())
+ 3
The input is a string '5' and not a number.
s = int(input()) will make it a number.
+ 2
What is the output?
+ 1
Ok.. got it.. tysm
0
How to return a string value?
0
Oh ok.. i was trying with
int x = input () which was error
Ty..