This repository was archived by the owner on Aug 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweight-tracker-01.py
49 lines (41 loc) · 1.62 KB
/
weight-tracker-01.py
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
##---------------------------------------------------------------------------##
# DOCUMENTATION
# If input is not working in "VSCode" Terminal, add this
# "code-runner.runInTerminal": true
# to Settings.json in .vscode folder
##---------------------------------------------------------------------------##
# MUTABLES
my_weights = ["78", "75", "65"]
##---------------------------------------------------------------------------##
# FUNCTIONS
def print_text_chart():
for i, number in enumerate(my_weights):
print(f"Week {i+1}", "-" * int(int(number) / 2), ">", number)
##---------------------------------------------------------------------------##
# APPLICATION
while True:
print("*" * 79)
print("*" + "My Weight Application".center(77) + "*")
print("*" * 79)
answer = input("(1-Enter weight, 2-Show weights, 3-Exit app): ")
if answer == "3":
print("[This application is ended]")
quit()
elif answer == "2":
print(my_weights)
print_text_chart()
else:
weight = input("Enter your new weight: ")
my_weights.append(weight)
##---------------------------------------------------------------------------##
# OUTPUT
"""
*******************************************************************************
* My Weight Application *
*******************************************************************************
(1-Enter weight, 2-Show weights, 3-Exit app): 2
['78', '75', '65']
Week 1 --------------------------------------- > 78
Week 2 ------------------------------------- > 75
Week 3 -------------------------------- > 65
"""