forked from Niilyx/quotes-nait-meddour-a
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
30 lines (25 loc) · 710 Bytes
/
main.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
from functions import *
def menu():
print("\n==== Programming Quotes ====")
print("1. Random quote")
print("2. All quotes")
print("3. Exit")
print("4. Add quote")
def main():
while True:
quotes = load_quotes("quotes.txt")
menu()
choice = input("Choose your an action (1-3): ")
if choice == "1":
print_quote(random_quote(quotes))
elif choice == "2":
view_quotes(quotes)
elif choice == "3":
print("Good bye...")
break
elif choice == "4":
add_quote(quotes, filename="Test")
else:
print("Invalid input")
if __name__ == "__main__":
main()