Let’s say I have the code (although it doesn’t do anything, just an example)
def myprint():
print("foobar")
foo = random.randint(1, 6)
myprint() * foo #Obviously doesn't work
What I want it to do is carry out print() ‘foo’ times. How do I do this?
You can change your code to this one: