python编写一个函数p(x),功能是判断参数x是哪一类数据?

2025-04-18 05:51:25
推荐回答(1个)
回答1:

def p(x):
try:
int(x)
if True:
print('是数字类型')
except ValueError:
print('是字符串类型')