Créer un pierre papier ciseaux est un bon exercice pour vous entraîner en Python et réaliser vos premiers projets.
Au programme, vous devrez créer :
une fonction qui génère de l’aléatoire : pierre, papier ou ciseaux une fonction pour vérifier et valider le coup qui vient d’être joué une fonction de résultat pour déclarer le vainqueur du tour un compteur de points pour suivre le score total
Le programme demande à l’utilisateur d’effectuer le premier coup avant d’effectuer un coup. Une fois le coup validé, l’entrée est évaluée, l’entrée saisie pouvant être une chaîne de caractères, une lettre ou un nombre. Après évaluation de la chaîne de caractères, la fonction de résultat détermine le gagnant et la fonction de comptabilisation des points actualise le score total.
Le projet a été développé avec Python 3.8.5 et ne nécessite aucune librairie particulière.
Merci au site Comment Coder (https://www.commentcoder.com/) pour ses idées de projets pour débutants dont ce projet est tiré.
Creating a rock paper scissors is a good exercise to train yourself in Python and make your first projects.
In the program, you will have to create :
a function that generates randomness: rock, paper or scissors a function to check and validate the move that has just been played a result function to declare the winner of the round a score counter to track the total score
The program asks the user to make the first move before to make a move. Once the move is validated, the input is evaluated, the input input can be a string, a letter or a number. After the result function determines the winner and the scoring function and the score function updates the total score.
The project has been developed with Python 3.8.5 and does not require any particular library.
Thanks to the Comment Coder site (https://www.commentcoder.com/) for its ideas for projects for beginners from which this project is taken.