+ 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.)
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])
+ 1
^^ Thank you!