Answer the question
In order to leave comments, you need to log in
How to deal with 2 Python lists?
I have code -
test1 ='два'
test2 ='шесть'
a = ['один', 'два', 'три', 'четыре', 'пять', 'шесть', 'семь']
b = a[a.index(test1):a.index(test2)+1]
print(b)
Answer the question
In order to leave comments, you need to log in
Didn't understand anything.
Why can't you just write:
test1 ='два'
test2 ='шесть'
a = ['один', 'два', 'три', 'четыре', 'пять', 'шесть', 'семь']
c = ['2020-07-01', '2020-07-02', '2020-07-03', '2020-07-04', '2020-07-05', '2020-07-06', '2020-07-07', '2020-07-08', '2020-07-09', '2020-07-10', '2020-07-11', '2020-07-12']
b = a[a.index(test1):a.index(test2)+1]
d = c[a.index(test1):a.index(test2)+1]
print(b)
print(d)
['two', 'three', 'four', 'five', 'six']
['2020-07-02', '2020-07-03', '2020-07-04', '2020-07 -05', '2020-07-06']
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question