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 Python Basics Functions and Looping Functions

zoltans
zoltans
2,547 Points

Can we make the body even shorter than Craig's version?Or will I run into difficulties later if I want to make changes?

def yell(text):

yell = text.upper() + "!" * (len(text) // 2)

print(yell)

yell("Hey you")

yell("Good morning")

1 Answer

Steven Parker
Steven Parker
231,198 Points

The course examples are likely constructed with a focus on clearly illustrating the use of the technique being introduced, and may not always be the most concise or efficient solutions possible.

The fact that you're thinking of effective alternative strategies is evidence of your learning progress and grasp of the material. Good job! :+1:

zoltans
zoltans
2,547 Points

Thanks a lot Steven! I'll try to think multiple solutions. Kind Regards,