Chapter 4b - Conditionals
If Conditionβ

isHot = int(input("Is it hot outside? Enter 1 if it is"))
#use if statement to check if user has entered 1
if isHot == 1:
print('Outside is hot') # Line 9
π§ͺ Try the code out~!

Else Conditionβ
isHot = int(input("Is it hot outside? Enter 1 if it is"))
#use if statement to check if user has entered 1
if isHot == 1:
print('Outside is hot') # Line 9
else:
print("not hot")
π§ͺ Try the code out~!
Fix the following program Problem:
- No matter what you enter it prints "Outside is hot"
- Fix the program so that it prints "Outside is hot" if
isHot=2
Click here to go to Zodiac Sign Project
You only need to complete this for this class. But if you would like to, feel free to peek into the topics below!
Checking Even and Odd numbers:β
π Lesson 4 Learning Activities [R] : Practice Activity 3 - Mathworks
- If
numberis odd the following program will printfalse. - If
numberis even, the program will printtrue
number = 4
print( number % 2 == 0)
- Modify the following program so that if the number is odd, it prints:
is Odd - And if it is even, it should print:
is Even
πββοΈ Expected Program:
Dictionary Orderβ
π Lesson 4 Learning Activities [R] : Practice Activity 5 - Dictionary Order
Write a program that asks user to enter 2 words and outputs them in the order they appear in the dictionary.
- hint: try running
"Bruce" < "Atom"
πββοΈ Expected Program:
Guessing Gameβ
π Lesson 4 Learning Activities [R] : Practice Activity 6 - Secret Word
In this game, you define a secret word and have the user of the game guess the secret word. Give the user two hints to help guess the word. The hint could be description of the word or partial secret word. Display the appropriate description of the game, first hint and prompt for the user to guess the word. If the user guesses the word then display success message and exit the game. If not then display the second hint. If the user is unable to guess the secret word after all the hints then display the secret word at the end of the game.
πββοΈ Expected Program:
π¨βπ¬ Feel free to use this template
Quiz About Meβ
π Lesson 4 Learning Activities [E2] : Python Challenge 4b - Quiz About Me
Create the following quiz but for yourself
πββοΈ Sample Program:
π¨βπ¬ Feel free to use this template