TristanSld

extend method in lists

Jan 8th, 2014
62
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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"
RAW Paste Data