Previous Lecture Complete and continue  

  Lesson 11: Lists of Things

6 comments
Miroslav
race[0::-1]
['john']

race[::-1]
['timothy', 'bob', 'john']

Question: If it's the same with or without the 0(zero) why is it the different answer?
Austin Koons
unfortunately I believe that he made a verbal mistake by saying those would be the same thing. "race[0::-1]" is saying to start at 'john', don't go past 'timothy' and go backwards. If it starts at 'john' and goes backwards from there, there is no more elements to go to. however, if tweaked a little bit, it becomes more useful. Let's say instead "race[1::-1]" in this case, we are saying start at 'bob' and go backwards. This instance will return to us "['bob' , 'john']. As just another example, if we say "race[:0:-1] we are not specifying a starting index, but we are saying it must not include the first element and this will give us "['timothy' , 'bob']".I hope this helped and sorry about how late it was of a response, seeing as you did this unit 6 days ago, and I just got to it.
Miroslav
After some brainstorming I've come to the same conclusion :)
And for the answer...better late than never ;)
nagi reddy
data=" iphone / new / 500 "

details = data. split("/")
print(details)

product = details[0]
condition = details[1]
prise = details[2]
prise1 = details[-1]
print(product)
print(condition)
print(prise)
print(prise1)
Tayseer
https://repl.it/EmvM/0
Moni AlFlahi
i asked Q on the last video , but nvm it u answered it here thnx anyways