I'm trying to get every word after the 2nd in my program. If I do
inputhere.split()[2]
I only get the 2nd word in the input, not every word after the 1st. How can I get every word after the 1st?
I'm trying to get every word after the 2nd in my program. If I do
inputhere.split()[2]
I only get the 2nd word in the input, not every word after the 1st. How can I get every word after the 1st?
Use a [i:]
to slice your list at a position i
: Understanding slicing
inputhere.split()[2:]