For one of my tasks, the user inputs multiple strings until they enter a blank line and then it prints it out in one line, this is how I did it.
words = []
word = input("Word: ")
while word:
words.append(word)
word = input("Word: ")
words = (' ').join(words)
print(words)
However, there's another part where it takes the first letter of each string in the list and prints it out in capital letters in one line. I cannot figure out how to print this on one line. This is my code:
words_split = words.split()
for word in words_split:
i = word[0]
print(i.upper())
e.g. If I entered ace, bravo, charlie
: it would print out
A
C
E
instead of
ACE
Can someone assist me thank you (: