Aug-29-2020, 05:30 AM
Hi!
I'm having some problems with spacing/formatting. I'm trying to get the pizza, state_tax, and pizza + state_tax outputs to start at directly under the 'H' in 'Here are the results:' and then have the numbers extend to the left. I tried <, >, and ^, but depending upon how big the pizza float is, the spacing doesn't match up. Any idea what I'm doing wrong?
Any help would be appreciated.
I'm having some problems with spacing/formatting. I'm trying to get the pizza, state_tax, and pizza + state_tax outputs to start at directly under the 'H' in 'Here are the results:' and then have the numbers extend to the left. I tried <, >, and ^, but depending upon how big the pizza float is, the spacing doesn't match up. Any idea what I'm doing wrong?
Any help would be appreciated.
def main(): name = 'Peter Tork' print('Welcome to Your Favorite Survey Program') print() print("Today we surveyed "+name+"." " Here are the results:") pizza = float(input ('11. If you order pizza, about how much would you pay before taxes? ')) tax = float(0.065) state_tax = pizza * tax print(f'10. Pizza Cost: ${pizza:^34,.2f}') print(f'State Tax: ${state_tax:^34,.2f}') print(f'Pizza Total: ${pizza + state_tax:,.2f}') main()