Python サイコロの合計を出す

# サイコロ二個の合計を出す.py 6/12/2022

"""
・サイコロの定義、二個作る方法、乱数でサイコロの目の合計を出す
 ・偶数・奇数の判断方法
・returnの使い方
 などを学びます。
"""

from random import randint

def dice():
    number = randint(1,6)
    return number

def dicegame():
    dice_1 = dice()
    dice_2 = dice()
    sum = dice_1 + dice_2
    if sum%2 == 0:
        print(f"{dice_1}と{dice_2}の合計は{sum}, で偶数です")
    else:
        print(f"{dice_1}と{dice_2}の合計は{sum}, で奇数です")

# dicegameを五回行う
for i in range(5):
    dicegame()
print("Game is over!")
"""
1と4の合計は5, で奇数です
4と4の合計は8, で偶数です
4と3の合計は7, で奇数です
4と4の合計は8, で偶数です
5と5の合計は10, で偶数です
Game is over!