【发布时间】:2019-11-20 04:41:08
【问题描述】:
我在这个惊人的网站上在线获得了同等比率。我很想模仿python中的输出或做同样的事情,但这有点超出我的技能。
你能帮我把它改成这种格式吗,这是python输出中前3对的样子,如果你能帮助我吗?我正在使用 python37
1:5618 2:11236 3:16854
这是我想要的网站: https://goodcalculators.com/ratio-calculator/
到目前为止,这是我的代码,但我希望有人可以帮助我,以便它以漂亮的花哨格式打印出来,或者只是以等效比率格式打印出一个很酷的数字列表:
它抛出一个错误,我不知道为什么,这是错误:
ValueError: invalid literal for int() with base 10: ' Enter 1st number for ratio calculation: '
while True:
a = input(int(' Enter 1st number for ratio calculation: '))
b = input(int(' Enter 2nd number for ratio calculation: '))
r = ( a/b and b/b)
print(r)
【问题讨论】:
标签: python calculation