I'm trying to generate random phone numbers. I'd like to output it into a file, but it only gets output once. I've already tried other code but it didn't work either.
import random
a = input(":")
b = input("amount:")
b = int(b)
c = "0123456789"
d = input("prefix:")
d = int(d)
for file in range(b):
a_file = open("Phone.txt", "w")
print(
a,
d,
random.choice(c),
random.choice(c),
random.choice(c),
random.choice(c),
random.choice(c),
random.choice(c),
random.choice(c),
random.choice(c),
random.choice(c),
random.choice(c),
random.choice(c),
sep="",
file=a_file)
a_file.close()
# var o = print...
#file = open("Phone.txt", "w")
#file_data = repr(o)
#file.write(repr(o))
#file.close