This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| loop = "s" | |
| def menu(): | |
| print(""" | |
| [N] - Cadastrar novo filme | |
| [L] - Listar filmes cadastrados | |
| [R] - Remover filme da lista | |
| [S] - Sair | |
| """) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| quartos = {} | |
| print("""Reservas Hotel Bom Descanso\n | |
| [N] = Nova reserva | |
| [D] = Deletar reserva | |
| [R] = Relatório | |
| [S] = Sair\n""") | |
| opcao = input("Escolha a opcão desejada: ").upper() | |
| while opcao not in {"N", "D", "R", "S", "Q"}: | |
| print("Opção inválida") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| quartos = {} | |
| print("""Reservas Hotel Bom Descanso\n | |
| [N] = Nova reserva | |
| [D] = Deletar reserva | |
| [R] = Relatório | |
| [S] = Sair\n""") | |
| opcao = input("Escolha a opcão desejada: ").upper() | |
| while opcao != "S": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| quartos = { } | |
| print("Reservas Hotel Bom Descanso") | |
| print("""[1]: Nova reserva | |
| [2]: Listar Quartos""") | |
| opcao = int(input("Digite a opção escolhida: ")) | |
| while opcao == 1: | |
| key = input("Digite o nome do hospede: ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| quartos = { | |
| 'Maria': 1, | |
| 'João': 2, | |
| 'Rodrigo': 3, | |
| } | |
| print("Reservas Hotel Bom Descanso") | |
| print("""Opção1: Nova reserva | |
| Opção2: Listar Quartos""") | |
| opcao = int(input("Digite a opção escolhida: ")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| multiplicado = int(input("Digite um número para o multiplicado: ")) | |
| for i in range(1, 11): | |
| print(f'{multiplicado} X {i} = {multiplicado * i}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for i in range(1, 50): | |
| if i % 2 == 0: | |
| print(i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| teams = ("Santos", "Oeste", "Água Santa", "Ponte Preta", "Santo André", "Palmeiras", "Novorizontino", "Botafogo SP", "São Paulo", "Mirassol") | |
| # Os 5 primeiros | |
| print(f'Os 5 primeiros times: {teams[:5]}') | |
| # # Os últimos 4 colocados | |
| print(f'Os 5 primeiros times: {teams[-4:]}') | |
| # Times em ordem alfabética | |
| print(f'Organizados alfabeticamente os times são: {sorted(teams)}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| multiplicado = int(input("Tabuada do: ")) | |
| multiplicador = 0 | |
| while multiplicador <= 10: | |
| print(f"{multiplicado} X {multiplicador} = {multiplicado * multiplicador}") | |
| multiplicador = multiplicador + 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| print('Vamos jogar?') | |
| userChoice = input('Escolha entre PEDRA, PAPEL e TESOURA: ').upper() | |
| if userChoice.upper() not in ('PEDRA', 'PAPEL', 'TESOURA'): | |
| print('Você não escolheu uma opção válida') | |
| else: | |
| machineChoice = random.choice(["Pedra", "Papel", "Tesoura"]).upper() |
NewerOlder