You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write a function translate that translates a list of words to piglatin
3
+
ex) input = ['hello', 'world']
4
+
output = ['ellohay', 'orldway']
5
+
6
+
remember, you can concactenate strings using +
7
+
ex) 'hello' + ' ' + 'world' = 'hello world'
8
+
'''
9
+
10
+
deftranslate( ):
11
+
# Your code here
12
+
13
+
phrase= (input("Enter a phrase -> ")).split() # takes a string as input and splits it into a list of strings; ex: hello world becomes ['hello', 'world']
14
+
piglatin=translate(phrase) # write the function translate
15
+
print(' '.join(piglatin)) # takes a list of strings and make them into one string with a space between each item; ex: ['hello', 'world'] becomes 'hello world'
0 commit comments