généralité

5 0 0
                                        

import random
def mdp():
  passeword = '1234'
  passe=input("quel est le mot de passe🔐")
  if passe == passeword:
    print("bienvenue🟩")
    menu()
  else:
    print("mot de passe incorrect 🟥")
def pile_face():
  choix=['pile','face']
  for h in range(int(input("combien de parties🎮? "))):
    choixx=input('pile ou face?🪙 ')
    ordi = random.choice(choix)
    if choixx == ordi:
      print('gagné🟩')
    else:
      print('perdu🟥')
def pierre_feuille_ciseaux():
  for h in range(int(input('combien de fois veux tu jouer?🎮 '))):
        choix = ('pierre', 'feuille', 'ciseaux')
        user = input('pierre🪨 feuille📄 ou ciseaux✂️? ')
        ordi = random.choice(choix)
        if user == ordi:
          print('égalité🟨')
        elif user == 'pierre' and ordi == 'ciseaux':
         print('gagné🟩')
        elif user == 'pierre' and ordi == 'feuille':
          print('perdu🟥')
        elif user == 'feuille' and ordi == 'pierre':
          print('gagné🟩')
        elif user == 'feuille' and ordi == 'ciseaux':
          print('perdu🟥')
        elif user == 'ciseaux' and ordi == 'feuille':
          print('gagné🟩')
        elif user == 'ciseaux' and ordi == 'pierre':
          print('perdu🟥')
        if user not in choix:
          print('erreur🟥')
  menu()      
def juste_prix():
  print('bienvenue dans le juste prix💵')
  prix = random.randint(1,100)
  for h in range(int(input('combien de chance veux tu avoir? 🎮 '))):
    nombre =int(input('quel est le prix?💵'))
    if nombre == prix:
      print('gagné🟩')
      break
    if nombre > prix:
      print('plus bas🔽')
    if nombre < prix:
      print('plus haut🔼')
  print('le prix était de',prix,'💵')
  menu()
def menu():
  print('1:pierre🪨 feuille📄 ciseaux✂️')
  print('2:pile ou face🪙')
  print('3:juste prix💵 ')
  mode = input('quel mode de jeux veux tu?🎮 ')
  if mode == '1':
    pierre_feuille_ciseaux()
  elif mode == '2':
    pile_face()
  elif mode == '3':
    juste_prix()
  elif mode == 'stop':
    print('au revoir👋')
  if mode not in ['1','2','3','stop']:
    print('erreur🟥')
mdp()
print('fin du jeux🎮')

Naabot mo na ang dulo ng mga na-publish na parte.

⏰ Huling update: Apr 13, 2024 ⏰

Idagdag ang kuwentong ito sa iyong Library para ma-notify tungkol sa mga bagong parte!

codage pythonTahanan ng mga kuwento. Tumuklas ngayon