Oct-10-2019, 07:09 AM
In order to save repeated typing one can use dictionaries and try...except:
email = 'somebody@somewhere' subject = 'I lost my license' header = (f'Dear customer {email},\n\n' 'Thank you for contacting our company.') footer = 'Thank you\n\nCompany customer service' categories = {'i lost my license': 'You will be contacted via email to verify you license request.\n\n', 'problem saving file': 'Saving file is done by pressing CTRL-S (Windows} or CMD- (Mac).\n\n'} try: print(f'{header}{categories[subject.lower()]}{footer}') except KeyError: print('Sorry, dada-dada-blah-blah')This way one needs to add only key-value pair to categories dictionary for additional subject.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.