短くするなら
A =[1,10,2,9,3,8,4,7,5,6]
print(A.index(8)+1)
ただ、この練習を活かすには
A =[1,10,2,9,3,8,4,7,5,6]
for i in range(len(A)):
if A[i] == 8:
print(i+1)
Go to list of users who liked
短くするなら
A =[1,10,2,9,3,8,4,7,5,6]
print(A.index(8)+1)
ただ、この練習を活かすには
A =[1,10,2,9,3,8,4,7,5,6]
for i in range(len(A)):
if A[i] == 8:
print(i+1)
Register as a new user and use Qiita more conveniently
Go to list of users who liked