User Tools

Site Tools


basics_ii

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

basics_ii [2023/10/13 04:14] – created appledogbasics_ii [2023/10/13 04:16] (current) appledog
Line 53: Line 53:
         quit()         quit()
                  
-    if guess == 'a':+    if answer == 1:
         print("The computer chose scissor!")         print("The computer chose scissor!")
          
-    if guess == 'b':+    if answer == 2:
         print("The computer chose paper!")         print("The computer chose paper!")
        
-    if guess == 'c':+    if answer == 3:
         print("The computer chose stone!")         print("The computer chose stone!")
                  
Line 67: Line 67:
 === Answer part II === Answer part II
 <Code:Python> <Code:Python>
-    if guess == 'a':+    if answer == 1:
         print("The computer chose scissor!")         print("The computer chose scissor!")
-        if answer == 1:+        if guess == 'a':
             print("It's a tie!")             print("It's a tie!")
-        elif answer == 2:+        elif guess == 'b':
             print("You win!")             print("You win!")
         else:         else:
basics_ii.1697170478.txt.gz · Last modified: 2023/10/13 04:14 by appledog

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki