Thursday, April 14, 2016

30 Days of Code Challenges : (Day 2) Operators

--------------------------------------------------------------------
# Enter your code here. Read input from STDIN. Print output to STDOUT
import math
metal_cost=float(input())
tip=int(input())
tax=int(input())
tip=metal_cost*tip/100
tax=metal_cost*tax/100
total=metal_cost+tip+tax
total=round(total)
print "The total meal cost is %d dollars." % total
--------------------------------------------------------------------

No comments:

Post a Comment

Two Sum

Given an array of integers, return indices of the two numbers such that they add up to specific target. You may assume that each input w...