Skip to content

模块 nonebot_plugin_marshoai.tools.marshoai_megakits.mk_common


async func random_turntable(upper: int, lower: int)

说明: Random Turntable

参数:

  • upper (int): description
  • lower (int): description

返回: type: description

源代码在GitHub上查看
python
async def random_turntable(upper: int, lower: int):
    return random.randint(lower, upper)

async func number_calc(a: str, b: str, op: str) -> str

说明: Number Calc

参数:

  • a (str): description
  • b (str): description
  • op (str): description

返回: str: description

源代码在GitHub上查看
python
async def number_calc(a: str, b: str, op: str) -> str:
    a, b = (float(a), float(b))
    match op:
        case '+':
            return str(a + b)
        case '-':
            return str(a - b)
        case '*':
            return str(a * b)
        case '/':
            return str(a / b)
        case '**':
            return str(a ** b)
        case '%':
            return str(a % b)
        case _:
            return '未知运算符'

文档完善中,欢迎提出建议或帮助我们完善。