+ 2

How do I display the text that the slice function ā€œsliced?ā€ from a variable

Iā€™m a fairly new python programmer and I just learned the slice function. How would I print the text from that. (Sorry, Iā€™m not good at explaining things.)

26th Dec 2017, 6:16 PM
RuthlessDust
RuthlessDust - avatar
2 Answers
+ 2
I think: print(put your slice command here) This is a sample from the python course: squares = [0, 1, 4, 9, 16, 25, 36, 49, 64, 81] print(squares[2:6]) print(squares[3:8]) print(squares[0:1])
26th Dec 2017, 6:47 PM
Paul
Paul - avatar
+ 1
^^ Thank you!
26th Dec 2017, 7:17 PM
RuthlessDust
RuthlessDust - avatar