PYTHON - How come a number inputted by a user isn't recognized if I try to find it's index?

前端 未结 0 1883
野性不改
野性不改 2021-02-19 06:55
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]

num = input(\'Enter a number: \')
a.append(int(num))
a.sort()
print(a)
print(a.index(num))
Enter a n         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题