On 2013-11-16 22:31, John Aten wrote:
Too bad that doesn't work.

No, it doesn't.  Can you see why?
Attached is a version that does work but you'd be better served looking at the two versions you already have and studying the error messages you get when you run them.



On Nov 16, 2013, at 11:16 PM, Alex Kleider wrote:

On 2013-11-16 13:20, Byron Ruffin wrote:
def main(x, y, z):
    print (x, y, z)
def funct():
    x = 1
    y = 2
    z = 3
    return x, y, z
main()
Can someone tell me why main is not being given any arguments?

Because you didn't give it any.
Try
main(funct())
instead.


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
#!/usr/bin/env python
# -*- coding : utf -8 -*-
# file: 'func0args'
"""
def main(x, y, z):
    print (x, y, z)
def funct():
    x = 1
    y = 2
    z = 3
    return x, y, z
main()
Put your docstring here.
"""
print "Running 'func0args'......."

def main1(tup):   # Argument must be an iterable (such as a tuple.)
    for letter in tup:
        print letter

def funct1():
    x = 1
    y = 2
    z = 3
    return x, y, z



main1(funct1())

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to