0
Why it doesn't work?
n = input().split(" ") # n = ['2', '3', '4'] print(n.index(2))
3 ответов
+ 5
use "n = [int(i) for i in input().split()]" or "print(n.index('2')"
0
n = list(input())#splits the input into a list containing each character
print(n[1]) #prints out the char
#[0] for 1st char
#[1] for 2nd char
try this
0
The list elements are strings
print(n.index( '2' )
will work