I have to create a function named "cheerleader" that produces the following output using parameters:
cheerleader(4, 3)
output Go Team Go Team Go
Go Team Go Team Go
Go Team Go Team Go
Go Team Go Team Go
A "cheer" is an occurrence of the word "Go" in the output. Neighboring cheers are separated by the word "Team", so 1 cheer is printed as "Go", 2 cheers as "Go Team Go", 3 cheers are printed as "Go Team Go Team Go", and so on.
This is the code I have so far but I can't figure out how to get part of the print of "Go Team Go" to print separate depending on the chants:
def cheerleader(line, cheers):
for i in range(line, cheers):
print(" " * (i * 3 - 3), end="")
print("Go Team Go")
cheerleader(2, 3)
cheerleader(4, 3)
output Go Team Go Team Go
Go Team Go Team Go
Go Team Go Team Go
Go Team Go Team Go
A "cheer" is an occurrence of the word "Go" in the output. Neighboring cheers are separated by the word "Team", so 1 cheer is printed as "Go", 2 cheers as "Go Team Go", 3 cheers are printed as "Go Team Go Team Go", and so on.
This is the code I have so far but I can't figure out how to get part of the print of "Go Team Go" to print separate depending on the chants:
def cheerleader(line, cheers):
for i in range(line, cheers):
print(" " * (i * 3 - 3), end="")
print("Go Team Go")
cheerleader(2, 3)