Last active
March 25, 2023 04:07
-
-
Save MedeirosJoel/355171142fbfd31913686e6bed0c6c0e to your computer and use it in GitHub Desktop.
Aplicativo de Listas do bremado
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
""" | |
Aplicativo de Listas do bremado | |
""" | |
lista_tarefas = [] | |
def imprime_lista(): | |
""" | |
Função que imprime a lista com seu respectivo indice | |
""" | |
indice = 0 | |
for tarefa in lista_tarefas: | |
print(indice, " - ", tarefa) | |
índice += 1 | |
def marcar_concluida(indice: int): | |
"""Gera uma string rasurada(taxada), para marcar que a tarefa já foi realizada""" | |
texto_rasurado = "" | |
for letra in lista_tarefas[indice]: | |
texto_rasurado+= letra + "\u0336" | |
lista_tarefas[indice] = texto_rasurado | |
def entrada_usuario(entrada: str): | |
""" | |
Recebe a entrada do usuario e verifa se é um texto ou um numero | |
""" | |
if entrada.isnumeric(): | |
marcar_concluida(int(entrada)) | |
else: | |
lista_tarefas.append(entrada) | |
while True: | |
"""Laço de execução principal do programa""" | |
imprime_lista() | |
entrada = input("Digite o numero para concluir, ou uma tarefa para adicionar: ") | |
entrada usuário(entrada) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment