Advertisement
TristanSld

extend method in lists

Jan 8th, 2014
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. #!/usr/bin/env python
  2. #-*-coding:utf-8-*-
  3. iller=["Antalya","Izmir","Istanbul"]
  4. print iller,"\n"
  5. iller.extend(["Mersin","Bolu","Trabzon"])
  6. print iller,"\n"
  7. #extend ile çok sayıda append ile tek sayıda eklenir
  8. iller.extend("Samsun")
  9. print iller,"\n"
  10. for harf in "Ankara":
  11.     iller.append(harf)
  12. print iller,"\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement