0
How to use for or while loop for this question
For every yard my team move I need to output Ra! that is if they move 3 time three Ra! If they move 4 time four Ra! as output this is my python code: if yards > 0 or yards < 10: yards = yards +0 x ="Ra!" x = x * yards print(x) How can I use for loop or while loop for it
2 Answers
+ 1
x = ""
for i in range(yards):
x += "Ra!"
print(x)
+ 1
Your if statement is too complicated, just do
if yards < 10:
#code here