Better explanation of .format usage in Hint


#1

I've found https://www.codecademy.com/forum_questions/501840eb93525c0002013c75 answer but the hint it self in 14. String Formatting with %, Part 1 isn't explained well. Especially for beginners. There is too much info at once at screen and I'm simply confused after few minutes of debugging :wink: it.
You may consider adding walkthrough through this subject!


#2

Using str.__mod__ (modulo, %) is the "old" way of doing string interpolation, the format method is preferred now.

With modulo you can usually use %s which just means to convert using default string conversion, like str(5)

print '%s' % 5

The equivalent with str.format is {}

print '{}'.format(5)

If you need to do something more fancy, google is your friend.