+ 1
(Answered) Please tell me why my code is printing vertically instead of horizontally.
7 Antworten
+ 9
x = input().split() is all you need for the first line (try it 😊).
split() generates a list by itself, so you don't need a list comprehension.
Also, input() always generates a string, so you don't need str().
+ 2
Check if your code has a new line character after every character/string/number in your print function
+ 2
and end=" " in print, because default is end="\n"
print(new_word + first_letter + "ay", end = " ")
+ 2
Thanks
+ 1
x = [str(x) for x in input().split()]
for words in x:
first_letter = words[0]
new_word = words[1:]
print(new_word + first_letter + "ay")
+ 1
Thanks