[Tutor] Why cant I return more than once here?

gerardo arnaez garnaez at gmail.com
Sun Mar 27 01:44:22 CET 2005


Hi all, I am working a simple function 
and want it return a
a float
a list
and a dictionary

But it seems that I can only use
return once in the function
cant see to figure out why I can return more than once?
Thanks for the help!
----------------------------------------------------------

#!/usr/bin/env python
def AddItUp():
# #Note I had to force the raw_input to become integers or else reduce
doesnt work
#     Monday = raw_input("Monday: ")
#     Tuesday = raw_input("Tuesday: ")
#     Wednesday = raw_input("Wednesday: ")
#     Thursday = raw_input("Thursday: ")
#     Friday = raw_input("Friday: ")
#     Saturday = raw_input("Saturday: ")
#     Sunday = raw_input("Sunday: ")

    InitalCoumadinWeekRegimen = {"Monday":float(Monday),
                             "Tuesday":float(Tuesday),
                             "Wednesday":float(Wednesday),
                             "Thursday":float(Thursday),
                             "Friday":float(Friday),
                             "Saturday":float(Saturday),
                             "Sunday":float(Sunday)
                                 }
    CoumadinValuesList  = InitalCoumadinWeekRegimen.values()
    return InitalCoumadinWeekRegimen
    return reduce ((lambda x,y: x+y), CoumadinValuesList), CoumadinValuesList


More information about the Tutor mailing list