Answer the question
In order to leave comments, you need to log in
How to get values from a list in a range?
There is a list:
['один', 'два', 'три', 'четыре', 'пять', 'шесть', 'семь']
test1 ='два'
test2 ='шесть'
[ 'два', 'три', 'четыре', 'пять', 'шесть']
Answer the question
In order to leave comments, you need to log in
a = ['один', 'два', 'три', 'четыре', 'пять', 'шесть', 'семь']
b = a[a.index(test1):a.index(test2)+1]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question