내장함수

Professor Ho's Wiki Site

  1. # coding:utf-8
  2.  
  3. abs(-334)
  4.  
  5. def sum(a,b):
  6.  return a+b
  7.  
  8. apply(sum,(34,55))
  9. print chr(97)
  10. print chr(98)
  11. print cmp(4,5)
  12. print cmp(5,4)
  13. print cmp(2,2)
  14.  
  15. print divmod(5,4)
  16.  
  17. aList = ["one","two","three","four"]
  18. for i,name in enumerate(aList):
  19.  print i,name
  20.  
  21. a = "1+2"
  22. print eval(a)
  23.  
  24. execfile('mod1.py')
개인 도구