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

8th Feb 2022, 9:23 AM
Emmanuel Toby
Emmanuel Toby - avatar
2 Answers
+ 1
x = "" for i in range(yards): x += "Ra!" print(x)
8th Feb 2022, 9:27 AM
The Iddmeister
The Iddmeister - avatar
+ 1
Your if statement is too complicated, just do if yards < 10: #code here
8th Feb 2022, 3:53 PM
Da GD Bot
Da GD Bot - avatar