<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><br><br><div><br></div><blockquote type="cite"><div><div dir="ltr"><div dir="auto"></div><div class="gmail_extra">That's covered under "format specifiers" I think.</div><div class="gmail_extra">The PEP mentions this: <a href="https://www.python.org/dev/peps/pep-0498/#format-specifiers">https://www.python.org/dev/peps/pep-0498/#format-specifiers</a></div></div></div></blockquote><div><br></div><div>I can see how a newbie might not realize that that means that f-strings use the same formatting language as the .format() method, and or where to find documentation for it.</div><div><br></div><div>So somewhere in the docs making that really clear, with a link to the formatting spec documentation would be good.</div><div><br></div><div>Not sure where though — a PEP is not designed to be user documentation.</div><div><br></div><div>-CHB</div><div><br></div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra">That specific example is not mentioned in the docs, but there other examples of using format specifiers with f-strings.</div><div class="gmail_extra"><a href="https://docs.python.org/3/reference/lexical_analysis.html#formatted-string-literals">https://docs.python.org/3/reference/lexical_analysis.html#formatted-string-literals</a></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">On Dec 15, 2017 7:39 AM, "Wagner Herculano" <<a href="mailto:wagherculano@hotmail.com" target="_blank">wagherculano@hotmail.com</a>> wrote:<br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div id="gmail-m_-4540779939052313272m_6000378074198687948divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<div style="color:rgb(0,0,0)">Good evening,
<div dir="ltr">
<div id="gmail-m_-4540779939052313272m_6000378074198687948x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div>I'm Wagner Herculano from Brazil.</div>
<div>
<div>I was trying to do a table exercise with number 5 and tried formatting spaces and did not find it in PEP 498 documentation.<br>
Finally I found a way, if possible, include this example in the documentation please.<br>
<br>
Below is my script with the desired formatting about table of 5.</div>
<div><br>
</div>
<div>
<div><i>n = 5</i><i><br>
</i></div>
<div><i>for i in range(1,11):<br>
print(f'{n} x <b>{i:>2}</b> = <b>{n*i:>2}</b>')<br>
<br>
Result <br>
5 x 1 = 5<br>
5 x 2 = 10<br>
5 x 3 = 15<br>
5 x 4 = 20<br>
5 x 5 = 25<br>
5 x 6 = 30<br>
5 x 7 = 35<br>
5 x 8 = 40<br>
5 x 9 = 45<br>
5 x 10 = 50</i></div>
<div><i>-----------</i></div>
<div><i>Sorry my English, I needed to use Google Translate</i></div>
<div><i><br>
</i></div>
<div><i></i>Best Regards,</div>
<div> Wagner Herculano<i><br>
</i></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>______________________________<wbr>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/mariatta.wijaya%40gmail.com" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/options/python-dev/mariatta.<wbr>wijaya%40gmail.com</a><br>
<br></blockquote></div></div>
</div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Python-Dev mailing list</span><br><span><a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a></span><br><span><a href="https://mail.python.org/mailman/listinfo/python-dev">https://mail.python.org/mailman/listinfo/python-dev</a></span><br><span>Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/chris.barker%40noaa.gov">https://mail.python.org/mailman/options/python-dev/chris.barker%40noaa.gov</a></span><br></div></blockquote></body></html>