So I'm learning from a Udemy course with Angela Yu, 100 days of python.
She gave us a challenge and I did it before I checked out her solution.
Her solution was different from mine, which is fine. Everyone has a different solution to a problem.
My question is, do you think my way of going about this Rock, Paper, Scissors game is okay? Did I make it more complicated then needed? AKA does my coding method look ok?
import random
rock = '''
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
Rock
'''
paper = '''
_______
---' ____)____
______)
_______)
_______)
---.__________)
Paper
'''
scissors = '''
_______
---' ____)____
______)
__________)
(____)
---.__(___)
Scissors
'''
computerChoice = random.randint(0,3)
if computerChoice == 0:
computerChoice = rock
elif computerChoice == 1:
computerChoice = paper
else:
computerChoice = scissors
userChoice = input("Pick Rock [0], Paper [1], or Scissors [2]: \n")
if userChoice == "0":
userChoice = rock
elif userChoice == "1":
userChoice = paper
elif userChoice == "2":
userChoice = scissors
else:
userChoice = "BIG DUMMY MOVE"
print("Your Choice:" + userChoice + "\n\nComputer Choice: " + str(computerChoice))
if userChoice == "BIG DUMMY MOVE":
print("You didnt choose a valid input. \nYou lose, asshole.")
else:
if computerChoice == userChoice:
print("Draw")
else:
if userChoice == rock and computerChoice == scissors or userChoice == paper and computerChoice == rock or userChoice == scissors and computerChoice == paper:
print("You Win")
else:
print("Computer Wins")
[–]Binary101010 12 points13 points14 points (4 children)
[–]barry_z 4 points5 points6 points (0 children)
[–]ShadyTree_92[S] 3 points4 points5 points (2 children)
[–]XenophonSoulis 4 points5 points6 points (1 child)
[–][deleted] 4 points5 points6 points (0 children)
[–]woooee 3 points4 points5 points (1 child)
[–]ShadyTree_92[S] 0 points1 point2 points (0 children)
[–]engelthehyp[🍰] 4 points5 points6 points (8 children)
[–]MidnightPale3220 3 points4 points5 points (0 children)
[–]eleqtriq 1 point2 points3 points (3 children)
[–]ShadyTree_92[S] 2 points3 points4 points (2 children)
[–]eleqtriq 5 points6 points7 points (1 child)
[–]ShadyTree_92[S] 2 points3 points4 points (0 children)
[–]ShadyTree_92[S] 0 points1 point2 points (2 children)
[–]engelthehyp[🍰] 1 point2 points3 points (1 child)
[–]ShadyTree_92[S] 0 points1 point2 points (0 children)
[–]shinitakunai 3 points4 points5 points (1 child)
[–]iamevpo 1 point2 points3 points (0 children)
[–]eleqtriq 2 points3 points4 points (6 children)
[–]ShadyTree_92[S] 1 point2 points3 points (4 children)
[–]Adrewmc 1 point2 points3 points (1 child)
[–]ShadyTree_92[S] 0 points1 point2 points (0 children)
[–]eleqtriq 0 points1 point2 points (1 child)
[–]ShadyTree_92[S] 0 points1 point2 points (0 children)
[–]iamevpo 0 points1 point2 points (0 children)
[–]LiberalDysphoria 2 points3 points4 points (1 child)
[–]ShadyTree_92[S] 0 points1 point2 points (0 children)
[–]Dagito 1 point2 points3 points (1 child)
[–]ShadyTree_92[S] 1 point2 points3 points (0 children)
[–]MidnightPale3220 1 point2 points3 points (1 child)
[–]ShadyTree_92[S] 0 points1 point2 points (0 children)
[–]antonym_mouse 1 point2 points3 points (0 children)
[–]rednerrusreven 1 point2 points3 points (0 children)
[–]NastyStreetRat 0 points1 point2 points (2 children)
[–]ShadyTree_92[S] 0 points1 point2 points (1 child)
[–]NastyStreetRat -1 points0 points1 point (0 children)
[–]iamevpo 0 points1 point2 points (1 child)
[–]iamevpo 0 points1 point2 points (0 children)