3.16 Hacks
import random
# Roll a six-sided dice and return the result
def roll_dice():
return random.randint(1, 6)
# Prompt the user for the number of dice rolls
num_rolls = int(input("Enter the number of times you want to roll the dice: "))
# Simulate rolling the dice the specified number of times and print the results
for i in range(num_rolls):
result = roll_dice()
print(f"Roll {i + 1}: {result}")
name = input("What is your name? ")
age = int(input("What is your age? "))
# Calculate the user's age in dog years
dog_years = age * 7
# Output the result
print("Hi, ", name, "! You are ", dog_years, " years old in dog years.")