Last active
July 31, 2023 20:34
-
-
Save NadiaaOliverr/8ee08b9090b675435dc4c2250ccb868c to your computer and use it in GitHub Desktop.
operador_ternario.py
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
| preco_pizza_frango = 25.00 | |
| preco_pizza_lombo = 30.00 | |
| # Condição usando o operador ternário | |
| escolha = "frango" if preco_pizza_frango <= preco_pizza_lombo else "lombo" | |
| print(f"Vou escolher a pizza de {escolha}!") # Saída: Vou escolher a pizza de frango! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment