Created
April 4, 2020 07:32
-
-
Save luizomf/bdb64a281d3c6842e70a04fb1654ff20 to your computer and use it in GitHub Desktop.
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
| # Para Type annotation | |
| from typing import List | |
| # Pilha de livros com type annotation | |
| stack_of_books: List[str] = [] # {1} | |
| # Adicionando livros no topo da pilha | |
| stack_of_books.append('Livro 1') # {2} | |
| stack_of_books.append('Livro 2') # {2} | |
| stack_of_books.append('Livro 3') # {2} | |
| # Obtendo o elemento mais novo | |
| book = stack_of_books.pop() # {3} | |
| print(book) # Livro 3 {4} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment