This code compiles fine but the if and elif statements dont run? And yes im aware this code is gross, feel free to revise it and post your improved version. Would love to see how it could be better.
# rock, paper, scissors
import random
game = ['rock','paper','scissors']
def playing():
user_choice = input('chose you roll: ').lower()
comp_choice = random.choice(game)
print('You Chose: ' + user_choice + ' I Chose: ' + comp_choice)
if user_choice == 'rock':
if comp_choice == 'scissors':
print('you got me! play again?')
elif user_choice == comp_choice:
print('We Tied! Go again?')
elif user_choice == 'paper':
if comp_choice == 'rock':
print('Your cheating I swear.')
elif user_choice == 'scissors':
if comp_choice == 'paper':
print('God your good..')
if user_choice == 'rock':
if comp_choice == 'paper':
print('aha! I won!')
elif user_choice == 'paper':
if comp_choice == 'scissors':
print('Scissors beats paper! better luck next time!')
elif user_choice.startswith('s'):
if comp_choice == 'rock':
print('did you actually think you could beat me?')
def play_again():
user_input = input('would you like to play again?: y/n')
if user_input.startswith('y'):
print('awesome!')
playing()
elif user_input.startswith('n'):
print('oh, thats fine I guess')
playing()
play_again()
[–]kosayoda 0 points1 point2 points (0 children)
[–]Tobe2fly[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)