I'm trying to make my Python code print an action five times in a row. Here's what I have so far:
```python
people = input("People: ")
action = input("Action: ")
print(f'And the {people} gonna {action}')
```
What's the best way to modify this so that it repeats the action five times?
2 Answers
You can use a for loop to do this! Just set it up like `for i in range(5): print(action)` and it'll loop five times to print the action.
Instead of manually printing the action multiple times, you can also do this: `print(f'And the {people} gonna ' + f'{action} ' * 5)`. This will concatenate the action with spaces between each repeat.
But how do I make sure there's a space between each action?