mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-02-07 18:36:09 +08:00
1.6 KiB
Executable File
1.6 KiB
Executable File
title |
---|
mk_common |
模块 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上查看
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上查看
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 '未知运算符'