+ 1
Here if I want to add B and percent how should I do it ? It is always coming wrong because iteger can't be added with variable.
8 Réponses
0
??
print(A+B)
print(A%B)
0
What do you want to say bro? I am not getting the required result
0
I mean, Question is not clear to me!
It you want add B means
print(A+B) ?
Persent means print(A%B)?
What do you mean by " Because integer can't be added with variable"?
Ishaan9090 add a sample expected output for example....!
0
I am telling that in the program I want to make a tip calculator in which I want to make(for ex. 100 +"%")The result should be 100 % displayed together.Whatever the total amout the viewer will enter,with the percentage of the amount we want to give,the amout should come with"₹ rupees" symbol and percentage with "%" symbol.But they should be outputed together
0
It should come like for example:
100%
And
₹whatever it is
0
Convert all to str types, while printing..
Or use camma separate values in print.
0
A=int(input())
print("Total bill:",'₹'+str(A))
B=int(input())
print("Percentage of the bill you want to give to the waiter:", str(B)+'%', "percent")
C=(A * B)
print("Multiplied the amount to the percent: ")
print('₹'+str(C))
D=(C//100)
print("Amount you will give to the waiter:")
print('₹'+str(D))
0
Ok