# INPUT DATA
data = [
    (1000, 10),
    (2000, 17),
    (2500, 170),
    (2500, -170),
]
# Print the header for reference
print('REVENUE | PROFIT | PERCENT')

# This template aligns and displays the data in the proper format
TEMPLATE = '{revenue:>7,} | {profit:>+7} | {percent:>7.2%}'

# Print the data rows
for revenue, profit in data:
    row = TEMPLATE.format(revenue=revenue, profit=profit, percent=profit / revenue)
    print(row)
Este artigo foi útil ?
SimNão

6 Replies to “print Template String Python”

  1. b9casinologin disse:

    Yo, B9CasinoLogin! Checked you guys out. Site’s pretty slick, easy to navigate, and the games look fire. Hopefully the payouts are just as good, eh? Give it a whirl! b9casinologin

  2. r7betbr disse:

    Heard good things about the R7betbr promotions, so I signed up. Got a decent welcome bonus which was cool. The site is targeted to the Brazilian market, so the language and currency are on point if that’s what you’re after. Solid option if you’re in Brazil looking for a reliable betting platform: r7betbr

  3. strendusmex disse:

    Strendusmex, now that name rings a bell. I’ve seen a few ads, looks slick and modern. Might be worth a shot if you’re looking for something a bit more up-to-date than the usual. See for yourself: strendusmex

  4. lucky102login disse:

    Just signed up at lucky102login. The login process was super easy, no complicated stuff. I started slow but am enjoying the game selection! Give it a try with lucky102login

  5. vn88.com dj disse:

    Alright alright, vn88.com dj is a little different, right? More than just games, they have some cool live stuff too. If you’re into that, give it a try. Solid enough. vn88.com dj

  6. betfiery44 disse:

    Betfiery44… that name sounds hot! Let’s hope my winnings catch fire too! Ready to win big! Join the heat at betfiery44!

Deixe um comentário para vn88.com dj Cancelar resposta

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

Close Search Window