Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- # RadarEletronico.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.
- #
- #
- # Bibliotecas importadas
- from time import sleep
- from random import choice
- # Imprimir Título
- print('\n' * 2)
- print('{:_^40}'.format('RADAR ELETRÔNICO'))
- # Declaração da função radar()
- def radar():
- # o policial rodoviario está trabalhando rsrsrs
- prf_trabalhando = True
- while prf_trabalhando:
- print('\n' * 2)
- print('VEÍCULO PASSANDO...')
- sleep(1)
- velocidade = float(input('A que velocidade o veículo passou? '))
- placa = str(input('Placa do veículo: ')).upper()
- # Sorteio dos nomes através do choice
- lista_nome = ['joão', 'jonas', 'pedro', 'sebastião', 'josé', 'tereza', 'maria', 'joana']
- nome = choice(lista_nome).upper()
- lista_sobrenome = ['da silva', 'de souza', 'de paula', 'santos']
- sobrenome = choice(lista_sobrenome).upper()
- print('CHECANDO A VELOCIDADE...')
- sleep(1)
- print('CHECANDO A PLACA {}...'.format(placa))
- sleep(2)
- print('PROCESSANDO...')
- sleep(3)
- # A velocidade da via é de 80km/h
- if velocidade <= 80:
- print('VEÍCULO SEM DENÚNCIA DE ROUBO...\nSEM MULTAS...\nBOA VIAGEM!!!')
- else:
- # Multa de R$7.00 por km excedente
- multa = 7 * (velocidade - 80)
- print('O VEÍCULO ESTÁ ACIMA DA VELOCIDADE...')
- print('IMPRIMINDO MULTA...')
- sleep(2)
- print('SR(A). {} {},\n MULTA DE R${:2.2f} NA PLACA {} POR EXCESSO DE VELOCIDADE...\nO VALOR PODE SER PAGO EM QUALQUER BANCO OU CASA LOTÉRICA...'.format(nome, sobrenome, multa, placa))
- # Excução da função radar()
- radar()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement