Python Forum

Full Version: Overloading error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
def add(instanceOf,*args):
    if instanceOf== <int>:
        result=0
    if instanceOf== <str>:
        result=<>!
    for i in args:
         result=result+1
         return result
print(<int>,3,4,5)
print(<str>,<i>,<live>,<in>)

am new to python currently learning oop chapter so try this code to run but it's giving me error in <int> second line.