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
Nicholas Anstis
2,095 PointsIssue with .format on triple """ ( print(""" """)
So, I have this draw_skeleton function with a printed skeleton on it so i have to use the triple """ but i can't get it formated with anything i get a ValueError back. I don't understand why.
Here's my code it's located on Personal_game.py : https://w.trhou.se/75mcyq871u
2 Answers
Matthew Hill
7,799 PointsThe problem is the curly braces located on your skeleton's nose. You can simply substitute them for '|' instead and this works fine. Or, if you still want the braces, you can insert two additional {}, then format as:
...""".format(health, "}", "{"))
As a side note, your argument 'enemy' seems redundant, unless you're planning on using it in your function later you're already selecting that particular 'enemy' by specifying the name of the function call.
Nicholas Anstis
2,095 PointsOk thanks a lot :D