+ 2

What if try to index the tuples like 0:10 where there is only 3 values

https://code.sololearn.com/c49JfvoX5w3u/?ref=app

18th Jun 2021, 2:19 PM
Ahnaf Muttaki Omor
Ahnaf Muttaki Omor - avatar
2 odpowiedzi
+ 2
Yes, ie. for 0:2 the result is ('one', 'two'). Did you see it? One step after you can learn it: https://www.sololearn.com/learning/2453/
18th Jun 2021, 3:34 PM
JaScript
JaScript - avatar
+ 3
In this code it prints out the first element if we index it like lists using [0]. But what if we use [0:10] while indexing? It prints out all the values in the tuple containing in this code.. But is there any rule or advice regarding it 🙄?
18th Jun 2021, 2:22 PM
Ahnaf Muttaki Omor
Ahnaf Muttaki Omor - avatar