#!/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')
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)