-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex18.py
More file actions
31 lines (25 loc) · 649 Bytes
/
ex18.py
File metadata and controls
31 lines (25 loc) · 649 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/env python
# -*- coding: utf-8 -*-
#:Tital: ex18.py
#:synopsis: ex18.py
#:Date: 2012-12-26
#:Version: 1.0
#:Author: lovvvve
#:Options:
#this one is like your scripts with argv
def print_two(*args):
arg1,arg2=args
print "arg1: %r, arg2: %r" %(arg1,arg2)
#ok, that *args is actually pointless,we can just do this
def print_two_again(arg1,arg2):
print "arg1: %r, arg2: %r" %(arg1,arg2)
#this just takes one argument
def print_one(arg1):
print "arg1: %s" % arg1
#this one takes no arguments
def print_none():
print "I got nothin'."
print_two("Zen","Shaw")
print_two_again("Zen","Shaw")
print_one("First!")
print_none()