-
-
Save copysolo/50557dba26d4488c505ea3d527ab8341 to your computer and use it in GitHub Desktop.
correction TP
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
| def main(): | |
| # recolter une valeur porte monnaie | |
| wallet = int(input("Entrer le nombre d'€ que vous possedez")) | |
| print("Vous avez actuellement", wallet, "euros") | |
| # creer un produit qui aura pour valeur 50 | |
| produit = 50 | |
| print("Le Produit vaut ", produit, "euros") | |
| # enleve au "wallet" le prix du produit | |
| wallet = wallet - produit | |
| # ou wallet -= produit | |
| # afficher la nouvelle valeur | |
| print("Produit acheté !") | |
| print("Il ne vous reste plus que", wallet, "euros") | |
| if __name__ == '__main__': | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment