Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Combiner method - try again but runs ok on bash ..

could someone look into the code, please? runs ok on bash, tried different numbers both fl and int, checked the returned type is string, something is still off this equation..

running combiner(["cat","milk",3.5,11])
output: catmilk14.5 <type 'str'>

thanks so much, the People of Treehouse <(. .)> /bowing in silence/

instances.py
def combiner(my_list):
    totals_string = []
    totals_int = []
    for element in my_list:
        if isinstance(element,str):
            totals_string.append(element)
        elif isinstance(element, (int,float)):
            totals_int.append(element)
    all_totals = ''.join(totals_string) + str(sum(totals_int)) 
    return all_totals

1 Answer

Stuart Wright
Stuart Wright
41,120 Points

I just copy/pasted your code into the challenge and it passes for me - maybe try it again?

that's crazy, it just worked from IE but not from Chrome - I guess I have to keep trying to submit the answer...thank you, Stuart, 2nd time - same issue :D