<div>Format is my preferred way for handling stings. </div><div><br></div><div>Basically it takes args or kwargs. Super easy to read and understand:) </div><div><br></div><div>N</div><div><br></div><div><br></div><div><div class="gmail_quote"><div>On Thu, Jan 5, 2017 at 7:40 PM <<a href="mailto:foo7775@comcast.net">foo7775@comcast.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg"><div style="font-family:Arial;font-size:12pt;color:#000000" class="gmail_msg"><div class="gmail_msg">Wow - can't believe the insanely-quick response with the perfect answer!!  *THANK YOU* Nick, that was *really* frustrating to me!!<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Now to study up on why/how that worked...<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Again, *THANK YOU*!!<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">T.</div><hr id="m_5330788780053055240zwchr" class="gmail_msg"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt" class="gmail_msg"><b class="gmail_msg">From: </b>"Nick Lang" <<a href="mailto:nick@nicklang.com" class="gmail_msg" target="_blank">nick@nicklang.com</a>><br class="gmail_msg"><b class="gmail_msg">To: </b>"Front Range Python Users -- General Discussion" <<a href="mailto:frpythoneers@lists.community.tummy.com" class="gmail_msg" target="_blank">frpythoneers@lists.community.tummy.com</a>><br class="gmail_msg"><b class="gmail_msg">Sent: </b>Thursday, January 5, 2017 7:24:46 PM<br class="gmail_msg"><b class="gmail_msg">Subject: </b>Re: [FRPythoneers] Hi All...</div></div></div><div class="gmail_msg"><div style="font-family:Arial;font-size:12pt;color:#000000" class="gmail_msg"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt" class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Try `print("The discount is {}%".format(disc))`</div><div class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">On Thu, Jan 5, 2017 at 7:18 PM <<a href="mailto:foo7775@comcast.net" class="gmail_msg" target="_blank">foo7775@comcast.net</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg"><div style="font-family:Arial;font-size:12pt;color:#000000" class="gmail_msg"><div class="gmail_msg">Hello everyone, & happy 2017.<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">  I'm a n00b to this list, & also to Python, although I'm reasonably comfortable with shell scripting in bash, & I've played around a *little* bit with Perl.  I'm currently working my way through a Kindle e-book on Python, & I've smacked my head into an issue that (so far, at least) I haven't been able to reason my way out of.  The original "assignment" was to prompt the user for:<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">   an original price for an item,<br class="gmail_msg"></div><div class="gmail_msg">   a discount percentage,<br class="gmail_msg"></div><div class="gmail_msg">   and then to calculate the total price for the item once the discount (+ a static sales tax percentage) was factored in.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I took a couple of runs at how to lay out the math, but came up with the following fairly quickly, which seems to work:<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><span style="font-family:lucida console,sans-serif" class="gmail_msg">     TAX = 8.5</span><br class="gmail_msg"><br class="gmail_msg"><span style="font-family:lucida console,sans-serif" class="gmail_msg">    initial = int(input("Please enter the item's price: "))</span><br class="gmail_msg"><span style="font-family:lucida console,sans-serif" class="gmail_msg">    disc = int(input("Please enter any applicable discount "))</span><br class="gmail_msg"><br class="gmail_msg"><span style="font-family:lucida console,sans-serif" class="gmail_msg">    print ("Item price is ", initial )    # The 'initial' variable is proven to be working correctly here</span><br class="gmail_msg"><span style="font-family:lucida console,sans-serif" class="gmail_msg">    print ("The discount is ", disc '%')  # Same for the 'disc' variable</span><br class="gmail_msg"><br class="gmail_msg"><span style="font-family:lucida console,sans-serif" class="gmail_msg">    price = (initial * ((100 - disc) / 100) * (1 + (TAX / 100)))</span><br class="gmail_msg"><span style="font-family:lucida console,sans-serif" class="gmail_msg">    print ("Total price is ", price )</span><br class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Now the overall program (as shown above) basically works as I expected/intended.  I can enter an "original price", enter a discount percentage, & get a "total price" that is consistent with the value that I receive when I perform the same process with a calculator.  The issue is <em class="gmail_msg">(essentially)</em> one of formatting.  In the second print line (the one containing the 'disc' variable), what I *want* to do is to include a literal 'percent sign' character (i.e., '%') in the output - but regardless of how I try to quote or escape that character, I have yet to hit upon the arcane combination that allows me to see the string<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">    The discount is 20% <em class="gmail_msg">(or whatever 'disc' value I enter)</em><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">in the output.<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I have worked my way through several web pages that attempt to explain the function of the % character, from the "somewhat arcane"...<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">    <a href="http://stackoverflow.com/questions/5306756/how-to-show-percentage-in-python" class="gmail_msg" target="_blank">http://stackoverflow.com/questions/5306756/how-to-show-percentage-in-python</a><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">to the entertaining & informative...<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">    <a href="http://importflying.com/2011/conversational-programming-how-to-use-the-percent-sign-operator-in-python/" class="gmail_msg" target="_blank">http://importflying.com/2011/conversational-programming-how-to-use-the-percent-sign-operator-in-python/</a><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">but none have provided the "Ah-ha!" moment that I've hoped for.<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I will happily admit that I've only barely gotten started with Python, so the example shown in the '<a href="http://stackoverflow.com" class="gmail_msg" target="_blank">stackoverflow.com</a>' link above could be entirely valid - but it's also essentially incomprehensible to me, so I need to ask - is what I'm trying to do *possible* for me at my level of expertise, or should I just "settle for" using a string like 'pct.' or 'percent' until I understand the '<a href="http://stackoverflow.com" class="gmail_msg" target="_blank">stackoverflow.com</a>' page???  <em class="gmail_msg">(Personal note - I'm fairly bullheaded/determined, so if there's ANY way to avoid it, I am *NOT* going to accept a workaround if I don't have to...)</em><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thank you in advance, I truly appreciate any efforts to "clear this up" for me.<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">T.<br class="gmail_msg"></div><div class="gmail_msg">(FWIW, I have a text file that shows the output of different things that I've tried, but I don't yet have any idea whether or not it's appropriate/accepted to include attachments to this list.  I am *more* than happy to share it with anyone who's interested in looking at it.  Thanks again.)<br class="gmail_msg"></div></div></div>_______________________________________________<br class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div>This message sent by the FRPythoneers mailing list.<br class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div>Unsubscribe: echo unsubscribe | <a href="mailto:FRPythoneers-request@lists.community.tummy.com" class="gmail_msg" target="_blank">FRPythoneers-request@lists.community.tummy.com</a><br class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div>URL: <a href="http://lists.community.tummy.com/mailman/listinfo/frpythoneers" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.community.tummy.com/mailman/listinfo/frpythoneers</a><br class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div></blockquote></div></div><br><br><br class="gmail_msg">_______________________________________________<br class="gmail_msg">This message sent by the FRPythoneers mailing list.<br class="gmail_msg">Unsubscribe: echo unsubscribe | <a href="mailto:FRPythoneers-request@lists.community.tummy.com" class="gmail_msg" target="_blank">FRPythoneers-request@lists.community.tummy.com</a><br class="gmail_msg">URL: <a href="http://lists.community.tummy.com/mailman/listinfo/frpythoneers" class="gmail_msg" target="_blank">http://lists.community.tummy.com/mailman/listinfo/frpythoneers</a><br class="gmail_msg"></div></div></div>_______________________________________________<br class="gmail_msg"><br>This message sent by the FRPythoneers mailing list.<br class="gmail_msg"><br>Unsubscribe: echo unsubscribe | <a href="mailto:FRPythoneers-request@lists.community.tummy.com" class="gmail_msg" target="_blank">FRPythoneers-request@lists.community.tummy.com</a><br class="gmail_msg"><br>URL: <a href="http://lists.community.tummy.com/mailman/listinfo/frpythoneers" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.community.tummy.com/mailman/listinfo/frpythoneers</a><br class="gmail_msg"><br></blockquote></div></div>