这个问题在这里已经有答案了
:
如何将输入读取为数字?
(10个答案)
22小时前就关门了。
让我们以下面的代码为例:
Women = (input("What's the number of women?"))
Men = (input("What's the number of men?"))
print("Percentage of Men: " + ((Men//(Men+Women))*100) + "\n Percentage of Women: " + ((Women//(Men+Women))*100))我收到一个错误
..。
我怎么才能解决这个问题呢?
发布于 2021-03-01 14:49:29
你应该试试,
Women = int(input("What's the number of women?"))
Men = int(input("What's the number of men?"))
Total = Men+Women
print(f' Percentage of men: {(Men/Total)*100} ')
print(f' Percentage of Women : {(Women /Total)*100}')https://stackoverflow.com/questions/66417616
复制相似问题