本题要求从键盘输入一个字符串,判断该串是否属于整数、浮点数或者复数的表示
输入一个字符串
输出yes或no
-299
yes
a = input() try: a = eval(a) if type(a) == int or type(a) == float or type(a) == complex: print(‘yes‘) else: print(‘no‘) except: print("no")
原文:https://www.cnblogs.com/aimilu/p/11818767.html