[Tutor] Help please!

ttmticdi . ttmticdi at gmail.com
Tue Jul 31 11:52:07 CEST 2012


> > print "Mum is in a %s mood" % (mum_mood)
> > print "Dad is in a %s mood" % (dad_mood)
>
>


Hi Victoria!

Since you have only one format character in the strings above there is
no need to surround the variables mum_mood and dad_mood with
parenthesis.
You only do that when you have multiple formats in your string that
print multiple variables.

Ex:

print "Hi %s! You like %s and %s" (user_name, x, y)



>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list