I am a beginner in Python and I am having some trouble getting the index from a list.
Here is my code:
color=['red','green' ,'yellow' , 'blue', 'grey']
gg=random.sample(color, 1)
print(gg)
jj=(farba.index(gg))
What I'm getting:
['green']
ValueError: ['green'] is not in list
Can anybody help me?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…