On 02/01/16 14:33, Ratheesh kumar wrote:
> But I can't get to understand what round() did int() cant't do
With this kind of question its best to ask the interpreter:
>>> int(12.1)
12
>>> int(12.9)
12
>>> round(12.1)
12
>>> round(12.9)
13
>>>
Does that make it clearer?
--
Alan G
Author of the
Hii everyone, Today i was just solving a problem in hacker-rank. A simple one
to calculate the tip and tax for the meal. The resultant answer should be
rounded off. I first wrote the code as below:
m=float(input())
x=int(input())
t=int(input())
tip=(m*x)/100
tax=(m*t)/100
total=m+tip+tax
print("T