We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 466849b commit 3bd1b74Copy full SHA for 3bd1b74
ex18.py
@@ -0,0 +1,21 @@
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
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 nothin'."
17
18
+print_two("Zed","Shaw")
19
+print_two_again("Zed","Shaw")
20
+print_one("First!")
21
+print_none()
0 commit comments