Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
ROCK PAPER SCISSORS game in Python ๐Ÿ—ฟ
Play lesson

Python tutorial for beginners ๐Ÿ - ROCK PAPER SCISSORS game in Python ๐Ÿ—ฟ

4.0 (0)
8 learners

What you'll learn

This course includes

  • 14.3 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

#python #tutorial #course Python tutorial for beginners rock paper scissors import random options = ("rock", "paper", "scissors") running = True while running: player = None computer = random.choice(options) while player not in options: player = input("Enter a choice (rock, paper, scissors): ") print(f"Player: {player}") print(f"Computer: {computer}") if player == computer: print("It's a tie!") elif player == "rock" and computer == "scissors": print("You win!") elif player == "paper" and computer == "rock": print("You win!") elif player == "scissors" and computer == "paper": print("You win!") else: print("You lose!") if not input("Play again? (y/n): ").lower() == "y": running = False print("Thanks for playing!")

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere