0
How do I input data for code coach?
I was working on the Pig Latin problem in Python, but I’m not sure how to input a sentence. I have tried: inputSentence = str(input()) but it doesn’t work. Any help is appreciated, thanks.
5 Antworten
+ 3
You don't need to convert input to string <<inputSentence = str(input())>>, as input always returns data in string format. But i am not sure if this is your issue. As we only can see this single line of code, we can give no help at the moment.
+ 3
A closing parenthesis at the end of the last line with print ... is missing.
+ 2
In each task is an example of input. Then this must be read accordingly.
+ 2
Thanks!
0
hi Ja Play I have removed the str() function and it still does not work. The following is my code:
inputSentence = input()
resultSentence = []
for word in inputSentence.split():
piggedWord = word[1:] + word[0] + 'ay'
resultSentence.append(piggedWord)
print(' '.join(resultSentence)
What is the issue?