-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpredict.py
More file actions
32 lines (27 loc) · 1.35 KB
/
predict.py
File metadata and controls
32 lines (27 loc) · 1.35 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
# **************************************************************************** #
# #
# ::: :::::::: #
# predict.py :+: :+: :+: #
# +:+ +:+ +:+ #
# By: obelouch <obelouch@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/12/13 00:36:02 by obelouch #+# #+# #
# Updated: 2020/12/14 04:32:52 by obelouch ### ########.fr #
# #
# **************************************************************************** #
from src.params import get_params
from src.ftMath import ft_isFloat
def predict():
'''
The Predict program
'''
user_input = None
while not ft_isFloat(user_input):
user_input = input('Please enter a mileage: ')
mileage = float(user_input)
# Get Thetas from the file if it exist
theta = get_params()
estimate_price = theta[0] + theta[1] * mileage
print(f'This car worth {round(estimate_price)} euro')
# Launch the program
predict()