Here there are a "num" amount of inputs. How do I get the nth input value?
num = input("How many values?")
for x in range(0, int(num)):
ok = input()
Store inputs in list.
num = input("How many values?")
ok=[]
for x in range(0, int(num)):
ok.append(input())
print(ok)
And for nth value:
ans = ok[n-1]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.