num=input("please input the num: ")
print "the number your input is: "+str(num)
def checktype(num):
    if isinstance(num,(int,long,float,complex)):##isinstance 是判断是否是一个类的实例,如果是返回true
        print str(num)+" type is "+type(num).__name__
    else:
        print str(num)+" type is not sure"
checktype(num)

  

相关文章:

  • 2021-10-12
  • 2022-03-07
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
猜你喜欢
  • 2021-07-09
  • 2022-12-23
  • 2021-11-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案