-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathletteran.py
116 lines (108 loc) · 4.58 KB
/
letteran.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
welcome = '''
,--,
,---.'|
| | : ___ ___
: : | ,--.'|_ ,--.'|_ BY LEONCYRIAC
| ' : | | :,' | | :,' __ ,-. ,---,
; ; ' : : ' : : : ' : ,' ,'/ /| ,-+-. / |
' | |__ ,---. .;__,' /.;__,' / ,---. ' | |' | ,---. ,--.'|' |
| | :.'| / \ | | | | | | / \ | | ,'/ \| | ,"' |
' : ;/ / |:__,'| : :__,'| : / / |' : / / / | | / | | PYTHON
| | ./. ' / | ' : |__ ' : |__ . ' / || | ' . ' / | | | | |
; : ; ' ; /| | | '.'|| | '.'|' ; /|; : | ' ; /| | | |/
| ,/ ' | / | ; : ;; : ;' | / || , ; ' | / | | |--'
'---' | : | | , / | , / | : | ---' | : | |/
\ \ / ---`-' ---`-' \ \ / \ \ /'---'
`----' `----' `----'
'''
print(welcome)
input("Welcome to the Letteren | Press enter to start.\n")
Letter1 = '''Dear <|NAME|>\n
\tCongratulations! You won <|PRIZE|>!\n
\tThank you for your participation!\n
\tTo claim your prize, please contact us at <|CONTACT|>\n
\tHave a nice day!\n
Regards, <|ORGANIZATION|>
Date: <|DATE|>'''
print("Enter your choice of letter:\n1 for prize letter\n")
choice = input("Which letter do you want to create?\n")
choice = int(choice)
if choice > 1:
print("Invalid choice.\n")
print("Please restart the program and enter a valid choice.\n")
exit()
if choice == 1:
print("You have chosen the prize letter.\n")
raw = input("If you want to view the raw letter, enter '1'.\notherwise,enter '2'.\n")
raw = int(raw)
if raw == 's':
print("Please enter the following information:\n")
name = input("Name : ")
prize = input("Prize : ")
contact = input("Contact : ")
organization = input("Organization : ")
date = input("Date : ")
Letter1 = Letter1.replace('<|NAME|>', name)
Letter1 = Letter1.replace('<|PRIZE|>', prize)
Letter1 = Letter1.replace('<|CONTACT|>', contact)
Letter1 = Letter1.replace('<|ORGANIZATION|>', organization)
Letter1 = Letter1.replace('<|DATE|>', date)
print("\n")
print("Your letter:\n",Letter1)
if raw == 1:
print(Letter1)
rchoice = input("\nPress enter 1 to customize.\n")
intchoice = int(rchoice)
if raw == 2:
print("Please enter the following information:\n")
name = input("Name : ")
prize = input("Prize : ")
contact = input("Contact : ")
organization = input("Organization : ")
date = input("Date : ")
Letter1 = Letter1.replace('<|NAME|>', name)
Letter1 = Letter1.replace('<|PRIZE|>', prize)
Letter1 = Letter1.replace('<|CONTACT|>', contact)
Letter1 = Letter1.replace('<|ORGANIZATION|>', organization)
Letter1 = Letter1.replace('<|DATE|>', date)
print("\n")
print("Your letter:\n",Letter1)
if raw > 2:
print("Invalid choice.\n")
print("Please restart the program and enter a valid choice.\n")
exit()
if intchoice > 1:
print("Invalid option!\n")
print("Please restart the program.\n")
exit()
if intchoice == 1:
print("Please enter the following information:\n")
name = input("Name : ")
prize = input("Prize : ")
contact = input("Contact : ")
organization = input("Organization : ")
date = input("Date : ")
Letter1 = Letter1.replace('<|NAME|>', name)
Letter1 = Letter1.replace('<|PRIZE|>', prize)
Letter1 = Letter1.replace('<|CONTACT|>', contact)
Letter1 = Letter1.replace('<|ORGANIZATION|>', organization)
Letter1 = Letter1.replace('<|DATE|>', date)
print("\n")
print("Your letter:\n",Letter1)
else:
print("Please enter the following information:\n")
name = input("Name : ")
prize = input("Prize : ")
contact = input("Contact : ")
organization = input("Organization : ")
date = input("Date : ")
Letter1 = Letter1.replace('<|NAME|>', name)
Letter1 = Letter1.replace('<|PRIZE|>', prize)
Letter1 = Letter1.replace('<|CONTACT|>', contact)
Letter1 = Letter1.replace('<|ORGANIZATION|>', organization)
Letter1 = Letter1.replace('<|DATE|>', date)
print("\n")
print("Your letter:\n",Letter1)
if intchoice > 1:
print("Please restart the program and enter a valid choice.\n")
exit()