Author Topic: Day 4 Project  (Read 545 times)

KingZimbabww

  • Newbie
  • *
  • Posts: 4
    • View Profile
Day 4 Project
« on: November 29, 2021, 03:31:20 am »
rock = '''
    _______
---'   ____)
      (_____)
      (_____)
      (____)
---.__(___)
'''

paper = '''
    _______
---'   ____)____
          ______)
          _______)
         _______)
---.__________)
'''

scissors = '''
    _______
---'   ____)____
          ______)
       __________)
      (____)
---.__(___)
'''

#Write your code below this line 👇
import random

you = input ("What do you choose? Type 0 for Rock, 1 for Paper, or 2 for scissors. ")
you = int(you)

if you == 0:
  print (rock)
if you == 1:
  print(paper)
if you == 2:
  print(scissors)

print("Computer chooses: ")
computer = random.randint(0,2)
if computer == 0:
  print (rock)
elif computer == 1:
  print(paper)
elif computer == 2:
  print(scissors)

if you == computer:
  print("It's a draw.")
elif you == 0 and computer == 1:
  print("You win!")
elif you == 2 and computer == 1:
  print("You win!")
else:
  print("You lose!")

Share on Bluesky Share on Facebook


Secure Da Bag

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Day 4 Project
« Reply #1 on: November 29, 2021, 03:43:07 am »
Just so you know, there's a thread for every Day.

https://forum.wethebrehs.com/100-days-of-code/day-4-randomisation-and-python-lists/

You can just post in there.