-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_tables_application.py
More file actions
75 lines (53 loc) · 2.03 KB
/
Copy pathcreate_tables_application.py
File metadata and controls
75 lines (53 loc) · 2.03 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
"""
To develop table application
1) Create function to display welcome message
2) Create function to display table input to be provided
3) Create function to get table detail
4) Create function to print table
5) Create function to ask user do you want print some more tables
6) Create function to display thank you message
7) Create function to run table application
a) Call welcome message function
b) Loop the below function but last function
c) call function to display table input provided
d) call function to get table input from the user
e) call the function to print with user input
f) call the function to the user to ask he wants to print any more table
if yes
repeat step c
else
stop the loop
g) call the thank you message function
8) Stop the application
"""
# 1) Create function to display welcome message
def welcome():
print('Welcome, in this application you can get the table you want to study')
# 2) Create function to display table input to be provided
def display_message():
print('Enter the table you want to study')
# 3 ) Create function to get table detail
def enter_table():
return int(input('Enter a table'))
# 4) Create function to print table
def print_table(table_value):
for table_run in range(1, 11):
print(table_value, "x", table_run, "=", table_value * table_run, sep=" ")
# 5 ) Create function to ask user do you want print some more tables
def continue_message():
print("Do you want to continue?")
return input("\t if yes press y\n") == "y"
# 6 ) Create function to display thank you message
def exit_message():
print('Thank you for using this application ')
# 7 ) Create function to run table application
def run_table():
run_table_ = True
welcome()
while run_table_:
display_message()
table_run = enter_table()
print_table(table_run)
run_table_ = continue_message()
exit_message()
run_table()