B
B
Babamurat2020-04-26 18:41:54
Python
Babamurat, 2020-04-26 18:41:54

How to check if the next element is in a list in Python?

eg :
n=[1,2,3,4]
index = 4
if n[index +1]==True :
instructions...

Please help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2020-04-26
@Babamurat

if len(n) >= index+1:
   инструкции..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question