10000 Add missing solution for review challenge from Ch08 · roxgunn/python-basics-exercises@9f8732f · GitHub
[go: up one dir, main page]

Skip to content

Commit 9f8732f

Browse files
committed
Add missing solution for review challenge from Ch08
1 parent 6aa39b8 commit 9f8732f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ch08-conditional-logic/4-challenge-find-the-factors-of-a-number.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,15 @@
88
for divisor in range(1, num + 1):
99
if num % divisor == 0:
1010
print(f"{divisor} is a factor of {num}")
11+
12+
13+
# Check whether the user inputs the number "3"
14+
15+
print("I'm thinking of a number between 1 and 10. Guess which one.")
16+
17+
number = input()
18+
19+
if number == "3":
20+
print("You win!")
21+
else:
22+
print("You lose.")

0 commit comments

Comments
 (0)
0