David Cheatham10,431 Points
Stuck on Instances
I feel like I must be missing something.
I run the code in a workspace and it spits out the correct result...
can someone look at it and tell me where I'm going wrong?
Thanks so much!
def combiner(*args): string = "" number = 0 for arg in args: if isinstance(arg, str): string += arg else: number += float(arg) if number == 0: number = "" return string + str(number) print(combiner("apple", 5.2, "dog", 8 ))
KRIS NIKOLAISEN54,331 Points
The challenge specifies that combiner takes a single argument so you don't need the splat operator.
should just be
Also remove the print statement at the end.