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

err

def yell(text): text = text.upper() number_of_characters = len(text) result = text * "!" * (number_of_characters // 2) print(result)

yell("sup shmulik") yell("derk")

treehouse:~/workspace$ python review1.py
Traceback (most recent call last):
File "review1.py", line 7, in <module>
yell("sup shmulik")
File "review1.py", line 4, in yell
result = text * "!" * (number_of_characters // 2)
TypeError: can't multiply sequence by non-int of type 'str'

I GET THIS ERR why

2 Answers

It looks like you are trying to multiply(*) by ! when you should be concatenating(+). Try this instead:

 result = text + "!" * (number_of_characters // 2)

thanks!!!