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
Benjamin Hedgepeth
5,672 PointsMultiple methods in a function
My goal is to have part of the string in uppercase. I have a placeholder where an adjective would be placed and this is where the .upper() method would take place, but I also want to use .format() in the same line of code.
Or is it simplier to just have an uppercase string just within the .format() ?
now = "Right now I'm having a {} time learning python."
1 Answer
Steven Parker
243,656 PointsAssuming the adjective is stored in a variable named adjective:
now = "Right now I'm having a {} time learning python.".format(adjective.upper())