如何添加最短日期和最长日期的日期
一个问题指出,我正在制作一个程序,其中用户添加了他在股票市场投资的天数。此后,他增加了价格,并以最高和最低的价格增加了最高和最低的价格。
N = int(input("Namuber of days: "))
x_list = []
for i in range(N):
x = float(input("Enter a set of stock prices on day{}: ".format(i+1)))
x_list.append(x)
print(max(x_list))
print(min(x_list))
A question states that I am making a program where the user adds the number of days he invested in the stock market. After that, he adds the prices and shows the highest and lowest price with the addition of the day at the highest and lowest price.
N = int(input("Namuber of days: "))
x_list = []
for i in range(N):
x = float(input("Enter a set of stock prices on day{}: ".format(i+1)))
x_list.append(x)
print(max(x_list))
print(min(x_list))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要打印
index
max
和min
价格。You need to print the
index
of themax
andmin
prices instead.