aboutsummaryrefslogtreecommitdiff
path: root/Python/Beginner training/003 Hotel.py
diff options
context:
space:
mode:
authorSyndamia <kami02882@gmail.com>2019-07-14 18:24:40 +0300
committerSyndamia <kami02882@gmail.com>2019-07-14 18:24:40 +0300
commit65edf7296baf48aad1b4e0c09b57f1a7f48791a8 (patch)
tree0c163496769d66363a4907cab3e72f42e5030c75 /Python/Beginner training/003 Hotel.py
parenta0addea2b7bbdac244420ec917c0f3c14c4c8831 (diff)
downloadSelf-learning-65edf7296baf48aad1b4e0c09b57f1a7f48791a8.tar
Self-learning-65edf7296baf48aad1b4e0c09b57f1a7f48791a8.tar.gz
Self-learning-65edf7296baf48aad1b4e0c09b57f1a7f48791a8.zip
Combined exam exercises files into one file, added a file for OOP exercises
Diffstat (limited to 'Python/Beginner training/003 Hotel.py')
-rw-r--r--Python/Beginner training/003 Hotel.py31
1 files changed, 0 insertions, 31 deletions
diff --git a/Python/Beginner training/003 Hotel.py b/Python/Beginner training/003 Hotel.py
deleted file mode 100644
index 0e2ed2a..0000000
--- a/Python/Beginner training/003 Hotel.py
+++ /dev/null
@@ -1,31 +0,0 @@
-import sys
-import os
-import math
-
-n_nights = int(input('Type number of nights: '))
-room_type = input('Type the type of room: ')
-
-price = 0.0
-if room_type == 'apartment':
- price = n_nights * 70
-else:
- price = n_nights * 125
-
-#code doesn't account for writing mistakes
-if n_nights < 10:
- if room_type == 'apartment':
- price *= 0.7
- else:
- price *= 0.9
-elif n_nights > 15:
- if room_type == 'apartment':
- price *= 0.5
- else:
- price *= 0.8
-else:
- if room_type == 'apartment':
- price *= 0.65
- else:
- price *= 0.85
-
-print('Total price: {}'.format(round(price, 2))) \ No newline at end of file