I want to write a program that prints a word 3 times. The first two iterations should have a space after them, but the 3rd line shouldn't.
Example of desired output: https://i.stack.imgur.com/XXEGD.jpg
This is the code I'm trying:
n = input("Enter a word: ")
for x in range(len(n)):
print((n[x]+" ")*3)
n.rstrip()
This is the output I'm getting - rstrip() doesn't seem to be working.
https://i.stack.imgur.com/GGL57.jpg
Any suggestions on how to fix this?