forked from Zipcoder/PyPart3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgreet.py
More file actions
34 lines (24 loc) · 889 Bytes
/
greet.py
File metadata and controls
34 lines (24 loc) · 889 Bytes
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
def greet(name,lang):
if (lang == 'E'):
print('Hello {}, pleased to meet you!'.format(name))
elif (lang == 'P'):
print("print('Hello {}, pleased to meet you!'.format(name))")
elif (lang == 'S'):
print('HI {}!'.format(name.capitalize()))
def name_input(lang):
if (lang == 'E'):
name = input('Enter your name: ')
elif (lang == 'P'):
name = input('name = ')
elif (lang == 'S'):
name = input('ENTER YOUR NAME! ')
return (name)
def lang_input():
lang = input('Choose a language for your greeting (E)nglish, (P)thon, or (S)houting: ')
if (lang[0].capitalize() != 'E' and lang[0].capitalize() != 'P' and lang[0].capitalize() != 'S'):
print('Please choose a valid option')
lang = lang_input()
return(lang)
lang = lang_input()[0].capitalize()
name = name_input(lang)
greet(name,lang)