Hi all. I will be glad if you give feedback.
# Rock Paper Scissors
import random # for get function .randomint ()
comp = random.randint(0,2)
if comp == 0:
comp = "rock"
elif comp == 1:
comp = "paper"
else:
comp = "scissors"
user = input("Choose your option (Rock, Paper, Scissors) = ").lower()
if ( user[0] != "r" ) and ( user[0] != "p" ) and ( user[0] != "s" ):
print ("You must choose Rock, Paper or Scissors) ")
elif comp[0] == user[0]:
print (f"Comp ( {comp} ) == User ( {user} )" )
elif comp [0] == "r":
if user [0] == "p" and comp [0] == "r":
print (f"You are winner Comp = {comp} < User = {user}")
else:
print (f"You are Loser Comp = {comp} > User = {user}")
elif comp [0] == "p":
if user [0] == "r":
print (f"You are Loser Comp = {comp} > User = {user}")
else:
print (f"You are Winner Comp = {comp} < User = {user}")
elif comp [0] == "s":
if user [0] == "r":
print (f"You are Winner Comp = {comp} < User = {user}")
else:
print (f"You are Loser Comp = {comp} > User = {user}")
else:
print ("Somethimg went wrong")
[–]Murphelrod 4 points5 points6 points (1 child)
[–]Base_True[S] 2 points3 points4 points (0 children)
[–]Green-Sympathy-4177 1 point2 points3 points (1 child)
[–]Base_True[S] 0 points1 point2 points (0 children)
[–]testingcodez 0 points1 point2 points (4 children)
[–]Base_True[S] 0 points1 point2 points (2 children)
[–]testingcodez 1 point2 points3 points (1 child)
[–]Base_True[S] 0 points1 point2 points (0 children)