def example():
    print("hello, world!")
times = int(input("how many 'hello worlds'? "))
for c in range(times):
    example()
That's an example of what I'm trying to do.
If I type "3" in the input, I want my .txt file to contain the output of the function I created, which is:
hello, world!
hello, world!
hello, world!
Is that possible? If so, how?
 
     
     
     
    