#!/usr/bin/python2.7
    def displayNumType(num):
    print num, 'is',
    if isinstance(num,(int, long, float, complex)):
            print 'a num of type:', type(num).__name__
    else:
            print 'not a  num at all'
displayNumType(-69)
displayNumType(99999999)
displayNumType(98.8)
displayNumType(-5.3+9.9j)
displayNumType('xxx')

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
  • 2022-02-06
  • 2021-07-25
猜你喜欢
  • 2021-12-12
  • 2022-01-14
  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
相关资源
相似解决方案