def dice_roll(arg: str):
    """ Dice roll as number of rolls (eg 6) or as num and sides (2x6)"""
    num, sides = 1, 6

    if arg.count("x") > 1:
        return None

    if "x" in arg:
        num, sides = arg.split("x")
    else:
        num = arg

    try:
        num = int(num)
        sides = int(sides)
    except ValueError:
        return None

    if num < 1 or sides < 1:
        return None

    return num, sides