forked from Zipcoder/PyPart3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultilingual_greeter.py
More file actions
33 lines (28 loc) · 991 Bytes
/
multilingual_greeter.py
File metadata and controls
33 lines (28 loc) · 991 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
#Asks the user for their name, inputs as string variable
def name_input():
print("Please enter your name. ")
provided_name = input()
return provided_name
#Inserts the name into the greeting
def greet(name):
print("Hello! How are you, ", name, "?")
greet(name_input())
#Allows the user to choose a language.
def language_input():
print("Please choose a language: \n A. Spanish \n B. French \n C. German")
language = input()
return language
#asks the user for their name in the chosen language
selection = language_input()
if (selection == "A" or selection == "a"):
print("What is your name in Spanish?")
new_name = input()
print("Hola, ", new_name, "!")
elif (selection == "B" or selection == "b"):
print("What is your name in French?")
new_name = input()
print("Bonjour, ", new_name, "!")
elif (selection =="C" or selection == "c"):
print("What is your name in German?")
new_name = input()
print("Hallo, ", new_name, "!")