string formatting django -
How do I access more than one variable at different positions?
Thank you!
Here is the code:
Import HTTPPOS from Django.http import. Digengo.context.ed Import from the models. Import user from favorites. Import * def main_page_favorites (request): title = favorite.bizzets.jet (id = 1) .title.upper () email = User.objects.get (user name = 'm'). Email Image = HyperLink.Obages GAT (id = 3) .URL output = '' '& lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; Connecting to the model & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; H1 & gt; Connecting to the model & lt; / H1> We will use this model to connect to the model & Lt; P & gt; This is the title of the first favorite:% s & lt; / P & gt; & Lt; / Body & gt;
>
Not sure what you are asking Do you just want to put multiple values in your string?
"Value is 1% s, value is 2% s." % (Value1, value2)
Comments
Post a Comment