fork download
  1. # this one is like your scripts with argv
  2. def print_two(*args):
  3. arg1, arg2 = args
  4. print "arg1: %r, arg2: %r" % (arg1, arg2)
  5.  
  6. # ok, that *args is actually pointless, we can just do this
  7. def print_two_again(arg1, arg2):
  8. print "arg1: %r, arg2: %r" % (arg1, arg2)
  9.  
  10. # this just takes one argument
  11. def print_one(arg1):
  12. print "arg1: %r" % arg1
  13.  
  14. # this one takes no arguments
  15. def print_none():
  16. print "I got nothing'."
  17.  
  18.  
  19. print_two("Zed","Shaw")
  20. print_two_again("Zed","Shaw")
  21. print_one("First!")
  22. print_none()
Runtime error #stdin #stdout 0.02s 4672KB
stdin
Standard input is empty
stdout
Standard output is empty