diff --git a/ch08-conditional-logic/4-challenge-find-the-factors-of-a-number.py b/ch08-conditional-logic/4-challenge-find-the-factors-of-a-number.py index 28d3a8e..6bcd21c 100644 --- a/ch08-conditional-logic/4-challenge-find-the-factors-of-a-number.py +++ b/ch08-conditional-logic/4-challenge-find-the-factors-of-a-number.py @@ -8,3 +8,15 @@ for divisor in range(1, num + 1): if num % divisor == 0: print(f"{divisor} is a factor of {num}") + + +# Check whether the user inputs the number "3" + +print("I'm thinking of a number between 1 and 10. Guess which one.") + +number = input() + +if number == "3": + print("You win!") +else: + print("You lose.")