Advertisement
aunkang

ค่าแทกซี่

Oct 14th, 2013
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. price = 35
  2. distance = input() #km
  3. for i in range(1,distance+1):
  4.     if i <= 1:
  5.         pass
  6.     elif i < 12:
  7.         price += 5
  8.     elif i < 20:
  9.         price += 5.5
  10.     elif i < 40:
  11.         price += 6
  12.     elif i < 60:
  13.         price += 6.5
  14.     elif i < 80:
  15.         price += 7.5
  16.     else:
  17.         price += 8
  18. price = int(price)
  19. print "Price" , price , "bath"
  20. print "Distance" , distance ,"km"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement