TristanSld

functions with variable-length arguments 1

Feb 14th, 2014
95
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. def adres_defteri(isim, soyisim, telefon, **arglar):
  5.     defter = {}
  6.     defter["isim"] = isim
  7.     defter["soyisim"] = soyisim
  8.     defter["telefon"] = telefon
  9.     for i in arglar.keys():
  10.         defter[i] = arglar[i]
  11.     for k, v in defter.items():
  12.         print "%s\t:\t%s" %(k, v)
  13.  
  14. adres_defteri(isim="Bayram",
  15. soyisim="Güçlü",
  16. telefon="02422424242",
  17. eposta="byrmgcl@yandex.com.tr",
  18. adres="Antalya",
  19. cep="05075075007")
RAW Paste Data