List : List Sliced : List PYTHON examples


PYTHON examples » List » List Sliced »

 

List


List: display a slice
 

inventory = ["sword""armor""shield""healing potion"]


begin int(raw_input("nEnter the index number to begin a slice: "))
end int(raw_input("Enter the index number to end the slice: "))
print "inventory[", begin, ":", end, "]tt",
print inventory[begin:end]


           
         
  



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo List
» List Sliced