-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# --coding=utf-8-- | ||
#this one is like your scripts with argv | ||
|
||
def print_two(*arg): | ||
arg1,arg2 = args | ||
print "arg1: %r, arg2: %r" % (arg1, arg2) | ||
|
||
#ok,that* args is actually pointless, we can just do this | ||
def print_two_agin(arg1,arg2): | ||
print "arg1: %r, arg2: %r" % (arg1, arg2) | ||
|
||
#this just takes one argument | ||
def print_one(arg1): | ||
print "arg1: %r" % arg1 | ||
|
||
#this one takes no arguments | ||
def print_none(): | ||
print "I got nothin'." | ||
|
||
|
||
print_two("Zed","Shaw") | ||
print_two_agin("CC","DD") | ||
print_one("Peter") | ||
print_none() |