小编Bor*_*LOC的帖子

如何通过输入显示输入数字的位置?

我有一个列表,一旦我对它进行排序以找到"最大值",我需要显示输入该数字的位置.

知道怎么做吗?

我制作了这个代码来接收和排序列表,但我不知道如何接收"数据"的初始位置.


liste = []

while len(liste) != 5:
    liste.append (int(input("enter number :\n")))

listeSorted = sorted(liste)
print("the biggest number is : ", listeSorted[-1]) 
Run Code Online (Sandbox Code Playgroud)

python list python-3.x

3
推荐指数
1
解决办法
128
查看次数

标签 统计

list ×1

python ×1

python-3.x ×1