Skip to content

Instantly share code, notes, and snippets.

@GravenilvecTV
Created November 24, 2018 19:19
Show Gist options
  • Save GravenilvecTV/9848be3ff531ee7c6d037148dac23f0e to your computer and use it in GitHub Desktop.
Save GravenilvecTV/9848be3ff531ee7c6d037148dac23f0e to your computer and use it in GitHub Desktop.
APPRENDRE LE PYTHON #2 ? LES VARIABLES
# 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")
@calim44
Copy link

calim44 commented May 19, 2024

def main():
wallet = 150
bluetooth_speaker= 75
result = (wallet - bluetooth_speaker)
print("il reste en monnaie " + str(result ))

@Chekino
Copy link

Chekino commented Jun 6, 2024

def main():
# recolter une valeur portmonnaie d'une personne
userwallet = int(input("entrer la somme du portmonnaie"))
# creer un produit qui auras pour valeur 50€
mangue = 50
# afficher la nouvelle valeur après son achat
monnaie = int(userwallet) - int(mangue)
# monnaie
print("la monnaie restante est "+str(monnaie))

if name == 'main':
main()

@Emmanuel20055
Copy link

#Récolter une valeur porte monaie
wallet = int(input("combien avez vous ?"))
#Créer un produit avec pour valeur
Produit = "voiture"
Prix = 50
#Affivher le nouvelle valeur du porte monaie après achat
wallet = wallet - Prix
print("après l'achat de la "+ Produit +" il vous reste "+ str(wallet) + "euro")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment