import random
def random_number_file_writer(nums):
f = open("random.txt", "w")
i = 0
while i < nums:
f.write(str(random.randint(1,500))+"\n")
i += 1
f.close()
def random_number_file_reader():
f = open("random.txt", "r")
total = 0
count = 0
for x in f.readlines():
total += int(x)
count += 1
print("The total of the numbers is "+str(total))
print("The number of random numbers read from the file is "+str(count))
def main():
random_number_file_writer(int(input("How many random numbers do you want to generate? ")))
random_number_file_reader()
main()
I hope this helps!
<span>Before you start creating a database, you should first use paper to plan, test, and revise. True or False?
TRUE</span>
There are different sizes like-mini computers, microcomputer, mainframe computer and super computer.
Answer:
D. nothing, as the alkyne would not react to an appreciable extent.
Explanation:
Nothing, as the alkyne would not react to an appreciable extent.