-
Notifications
You must be signed in to change notification settings - Fork 0
/
master-Calendar-v1.0.py
76 lines (63 loc) · 3.24 KB
/
master-Calendar-v1.0.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
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
76
daysOfWeek = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
charsOfDays = [None] * (len(daysOfWeek))
activitiesOfWeek = [None] * (len(daysOfWeek))
x = 'Your activities for the week are: '
numberDay = 0
userHasChangedCalendar = 0
assuranceOfTermination = 'yes'
def lengthOfDays():
for L in range(0, 7):
charsOfDays[L] = len(daysOfWeek[L])
def initialAcitivities():
for i in range(0, 7):
spaceNeeded = (max(charsOfDays) - charsOfDays[i] + 1)
spaces = ' ' * spaceNeeded
activitiesOfWeek[i] = str(input('What will the activity for ' + daysOfWeek[i] + spaces + 'be?... '))
def activitiesLister(x):
print('-' * (len(x) - 1))
print(x)
for i in range(0, 7):
print('\t' + str(daysOfWeek[i][0]) + '- ' + str(activitiesOfWeek[i]))
def changeOfCalendar(assuranceOfTermination, userHasChangedCalendar, numberDay):
changeOfCalendar = input('Would you like to change the activity for any of the days? Please type \'yes\' if yes and \'no\' if not... ').casefold()
if changeOfCalendar != 'yes' and changeOfCalendar != 'no':
while changeOfCalendar != 'yes' or changeOfCalendar != 'no':
changeOfCalendar = input('Error, please type \'yes\' if yes and \'no\' if not... ')
if changeOfCalendar == 'yes' or changeOfCalendar == 'no':
break
while changeOfCalendar == 'yes':
assuranceOfTermination = 'yes'
userHasChangedCalendar += 1
numberDay = int(input('''\n+ Please type the number of the day for which you would like to change the activity
(i.e. 0 for Monday, 1 for Tuesday, up until 6 for Sunday... )'''))
while numberDay < 0 or numberDay > 6:
numberDay = int(input('Error, the selection is only valid for numbers 0 - 6... '))
activitiesOfWeek[numberDay] = input('+ Please enter the activity you would like on {0} - '.format(daysOfWeek[numberDay]))
changeOfCalendar = input('\nWould you like to change the activity for any other day?... ').casefold()
if changeOfCalendar != 'yes' and changeOfCalendar != 'no':
while changeOfCalendar != 'yes' or changeOfCalendar != 'no':
changeOfCalendar = input('Error, please type \'yes\' if yes and \'no\' if not... ')
if changeOfCalendar == 'yes' or changeOfCalendar == 'no':
break
if changeOfCalendar == 'no':
assuranceOfTermination = input('\n\t---Are you certain you don\'t want to change anything else on your calendar? ')
if assuranceOfTermination == 'yes':
break
else:
continue
if changeOfCalendar == 'no':
print('-' * (len(x) - 1))
print('Your new activities for the week are: ')
for i in range(0, 7):
print('\t' + str(daysOfWeek[i][0]) + '- ' +str(activitiesOfWeek[i]))
print('Have a good week!')
lengthOfDays()
initialAcitivities()
activitiesLister(x)
print('-' * (len(x) - 1))
changeOfCalendar(assuranceOfTermination, userHasChangedCalendar, numberDay)
if userHasChangedCalendar != 0:
print('-' * (len(x) - 1))
print('Your new activities for the week are: ')
for i in range(0, 7):
print('\t' + str(daysOfWeek[i][0]) + '- ' + str(activitiesOfWeek[i]))