forked from codedlabs/python-cw-mini-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
52 lines (36 loc) · 1.28 KB
/
main.py
File metadata and controls
52 lines (36 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import math
def padel_cost_court(court_type):
if court_type == 'indoor':
idk = 30
if court_type == 'outdoor':
idk = 20
return idk
def rackets_cost(racket_brand):
if racket_brand == 'Bullpadel':
price = 100
if racket_brand == 'Nox':
price = 140
if racket_brand == 'Siux':
price = 200
return price
def padel_balls_cost(balls_boxes):
balls_price = 2
if int(balls_boxes) > 1:
# it suposed to minus 0.5 for each ball if the balls > 1
balls_price = ( 2 - ((0.5 * int(balls_boxes)) - 0.5) )
return balls_price
def padel_game_cost():
court_cost = input("indoor or outdoor ?: ")
racket = input("Racket brand? (Bullpadel - Nox - Siux: ")
ball_boxs = input("How many ball boxs would you like?: ")
hours = input("For how many hours?: ")
court_cost = padel_cost_court(court_cost)
racket = rackets_cost(racket.title())
ball_boxs = padel_balls_cost(ball_boxs)
if int(hours) >=3:
# it make a 20% discount if hours more than 2
total = (court_cost + racket + ball_boxs) * (int(hours) * (20/100))
else:
total = (court_cost + racket + ball_boxs) * int(hours)
return(total)
print("Total price is: " + str(math.ceil(padel_game_cost())) + "KD")