Essential Question: How can I use conditional statements to create a dice game?
Objectives:
SWBAT create complex conditional statements in python.
SWBAT create a dice game using random dictionary.
Do Now: Create a program that tests each word in a list of words and returns the longest word.
Directions: Using the code below, create two dice (a single dice is called a die) that roll a random number between 1-6. Then create an if statement that names each roll using the chart above. For instance, if you roll two ones, it is called snake eyes. Use logic gates such as "AND" in your statements and use If then statements and elif statements. Don't forget to include #!/bin/python3
if die1==1 and die2 ==1:
print("You have snake eyes.")
import random
die1 = random.randint(1,6)
print(die1)
The output should look something like this:
die1 = 1
die2 = 1
You rolled a snake eyes!