【发布时间】:2010-08-18 05:13:46
【问题描述】:
行数, 它的值在表单字段中动态设置。
现在由于 numberofrow 在多个表中, 当我从表单接收到该变量时,
如果只有一个 numerofrow,它是一个字符串,例如。 numberofrow = 01
如果多于一个 numberofrow,它是一个列表,例如。 numberofrow = [01, 02, 04]
现在我如何区分它在我的 python 代码中是列表还是字符串?
正在考虑使用,
if type(numberofrow).__name__=='list':
#do this
else:
#do this
谢谢, 晴天。
【问题讨论】:
标签: python