+ 3
How To print 2,3 or 4 consecutives numbers of a list ?
for example list[ 1,1,1,2,3,6,7]
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
0
thanks
0
You can use for loop
https://code.sololearn.com/cOetiNv8huyP/?ref=app