I'm writing a program that takes two inputs, number of lines and number of cheers as input. The number of lines is how many lines the user wants to print out and the number of cheers are in the format that 1 cheer is the word "GO" and two cheers are two "GO" s ...and their is the word "BUDDY" within two neighboring GO's. And each new line has to be indented 3 spaces more then the one before. And this is the program I've come up with:
lines = input("Lines= ")
cheers = input("Cheers= ")
if cheers == 1:
i = 1
space = 0
S = ""
while i<=lines:
S=S+(" "*space)+"GO \n"
i += 1
space+=3
print S
else:
n = 1
cheer1 = "GO BUDDY "
cheer2 = "GO"
space = 0
while n<= cheers:
print (" "*space)+(cheer1*cheers)+cheer2
space+=3
n += 1
But the problem with this is that it doesn't print out the right number of GO's in the number of cheers. How can I modify my code to fix this problem? This is the output format I want to get :
