# 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 1if 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 1if isHot == 1:  print('Outside is hot')      # Line 9else:  print("not hot")``
๐งช Try the code out~!
##### Exercise 1

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`
##### Time to work on our project!

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 `number` is odd the following program will print `false`.
• If `number` is even, the program will print `true`
``number = 4print( number % 2 == 0)``
##### Exercise 2
• 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

##### Exercise 3

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

##### Exercise 4

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

##### Exercise 5

Create the following quiz but for yourself

๐โโ๏ธ Sample Program:

๐จโ๐ฌ Feel free to use this template