Answer:
Explanation:
The following code is a Python function that takes in the amount of change. Then it uses division and the modulo operator to calculate the number of coins that make up the changes, using the greatest coin values first.
import math
def amountOfCoins(change):
print("Change: " + str(change))
quarters = math.floor(change / 0.25)
change = change % 0.25
dimes = math.floor(change / 0.20)
change = change % 0.20
pennies = math.floor(change / 0.01)
print("Quarters: " + str(quarters) + "\nDimes: " + str(dimes) + "\nPennies: " + str(pennies))
Answer: Wow that's really cool!
Answer: Isolation, Depression, Humiliation.
I hope this helps you out! ☺
Answer:
i think its d sorry if i am wrong
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!