fork(1) download
  1. # your code goes here
  2.  
  3. #which is called "index"
  4.  
  5. cities=["madurai","trichy","coimbatore","pudukkottai","aranthangi"]
  6. places=["pandi ayya","kallaiya","en amma selliyamman"]
  7.  
  8. print(cities[0])
  9. print(cities[:1])
  10. print(cities[0:])
  11. print(cities[2:5])
  12. print(places[0:])
  13.  
  14. #which is called "modify"
  15. #if i need to change the letters will have to do.
  16.  
  17. cities[0]="maduraai"
  18. print(cities)
  19. print(cities[0:])
  20. places[0]="sri pandi ayya"
  21. places[1]="sri kallaiya"
  22. places[2]="en amma sri sellitamman"
  23. print(places)
  24.  
  25. #which is called "append"
  26. #append which keans if you need to add the index what you need
  27.  
  28. cities.append("siruvarai")
  29. places.append("sri sampaan")
  30. print(cities)
  31. print(places)
  32.  
  33. #whuch is called insert
  34. #means if you need extra index
  35.  
  36. cities.insert(1,"kalakkamangalam")
  37. places.insert(1,"the ruler over the world")
  38. print(cities)
  39. print(places)
  40.  
  41.  
Success #stdin #stdout 0.02s 9184KB
stdin
Standard input is empty
stdout
madurai
['madurai']
['madurai', 'trichy', 'coimbatore', 'pudukkottai', 'aranthangi']
['coimbatore', 'pudukkottai', 'aranthangi']
['pandi ayya', 'kallaiya', 'en amma selliyamman']
['maduraai', 'trichy', 'coimbatore', 'pudukkottai', 'aranthangi']
['maduraai', 'trichy', 'coimbatore', 'pudukkottai', 'aranthangi']
['sri pandi ayya', 'sri kallaiya', 'en amma sri sellitamman']
['maduraai', 'trichy', 'coimbatore', 'pudukkottai', 'aranthangi', 'siruvarai']
['sri pandi ayya', 'sri kallaiya', 'en amma sri sellitamman', 'sri sampaan']
['maduraai', 'kalakkamangalam', 'trichy', 'coimbatore', 'pudukkottai', 'aranthangi', 'siruvarai']
['sri pandi ayya', 'the ruler over the world', 'sri kallaiya', 'en amma sri sellitamman', 'sri sampaan']