【发布时间】:2022-01-15 13:57:42
【问题描述】:
我想在每次运行到数组时保存 while 循环的结果。然后,一旦运行了所有转换,存储所有值的数组将被求和。
raw_user_age = input("Number: ")
x = int(raw_user_age)
g=0
while g < x :
if __name__ == "__main__":
YOUR_ACCESS_KEY = ''
url = 'https://api.exchangerate-api.com/v4/latest/USD'
c = Currency_convertor(url)
from_country = input("From Country: ")
to_country = input("TO Country: ")
amount = int(input("Amount: "))
returnedamount=c.convert(from_country, to_country, amount)
g += 1
print(returnedamount)
【问题讨论】:
标签: python arrays while-loop