We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d61225 commit 026379dCopy full SHA for 026379d
ch08-conditional-logic/3-control-the-flow-of-your-program.py
@@ -2,6 +2,7 @@
2
# Solutions to review exercises
3
4
5
+# --- Exercise 1
6
# Display whether the length of user input is <, > or = 5 characters
7
8
my_input = input("Type something: ")
@@ -12,3 +13,15 @@
12
13
print("Your input is greater than 5 characters long.")
14
else:
15
print("Your input is 5 characters long.")
16
+
17
18
+# --- Exercise 2
19
+# Number guessing program ("guess" the number 3)
20
21
+print("I'm thinking of a number between 1 and 10. Guess which one.")
22
+my_guess = input("Type in your guess: ")
23
24
+if my_guess == "3":
25
+ print("You win!")
26
+else:
27
+ print("You lose.")
0 commit comments