Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- # Taximetro.py
- #
- # Copyright 2021 Elizeu Barbosa Abreu <elizeubcorreios@gmail.com>
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- # MA 02110-1301, USA.
- #
- #
- from time import sleep
- import os
- from random import choice
- def cls():
- os.system('clear')
- def taximetro():
- tabela1 = ['0.9', '0.8', '0.7', '0.8', '0.7']
- preco_maior = choice(tabela1)
- preco_maior = float(preco_maior)
- tabela2 = ['0.65', '0.55', '0.45', '0.35', '0.25']
- preco_menor = choice(tabela2)
- preco_menor = float(preco_menor)
- print('{:^45}'.format('TAXIMETRO MALUCO'))
- print('\nESTE APP CALCULA O PREÇO DA CORRIDA...')
- sleep(2)
- cls()
- print('{:^45}'.format('TAXIMETRO MALUCO'))
- print('\nACESSANDO NOSSOS SERVIDORES...')
- sleep(2)
- cls()
- print('{:^45}'.format('TAXIMETRO MALUCO'))
- print('\nVERIFICANDO PREÇO POR KM PERCORRIDO...')
- sleep(2)
- cls()
- print('{:^45}'.format('TAXIMETRO MALUCO'))
- print('{:+>45}'.format(''))
- print('{:^45}'.format('TABELA DE PREÇO:'))
- print('Até 200KM: R${:.2f}'.format(preco_maior))
- print('Acima de 200KM: R${:.2f}'.format(preco_menor))
- print('{:+>45}'.format(''))
- distancia = float(input('\n\033[1;32;40mQual a distância da corrida?\33[m '))
- if distancia <= 200:
- print('\nO preço da corrida é de \033[1;30;43mR${:.2f}\033[m'.format(distancia * preco_maior))
- else:
- print('\nO preço da corrida é de \033[1;30;43mR${:.2f}\033[m'.format(distancia * preco_menor))
- print('{:+>45}'.format(''))
- sleep(5)
- cls()
- c = True
- while c:
- taximetro()
Add Comment
Please, Sign In to add comment