+ 3

How To print 2,3 or 4 consecutives numbers of a list ?

for example list[ 1,1,1,2,3,6,7]

21st Oct 2018, 9:27 PM
Ségolène
3 ответов
+ 4
Python is a little different in this compared with another languages you simple just can print(object) in your case: print(list) it will print 0 to Last position Another thing you can do is just use sliccing Like this print(list[2:5]) this prints position 2 to 5 (remember. to start count with 0) Here some example: https://code.sololearn.com/c3fiXhcCM0x9
21st Oct 2018, 9:35 PM
Anya
Anya - avatar
0
thanks
21st Oct 2018, 9:39 PM
Ségolène
21st Oct 2018, 11:34 PM
Rich