判斷是否為字串

def isastring(string):
    try:string+''
    except:return False
    else:return True
print(isastring('123'))

0 意見:

張貼留言