I want to take a function and repeat it by an amount which a user will input. Thanks in advance!

Recommended Answers

All 2 Replies

Use for loop with range.

Like Tony recommends:

def ten_times(n):

x = int(input("How many repeats (enter an integer value): "))

for n in range(x):
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.