看板
[ Python ]
討論串[問題] 請問怎麼宣告輸入為不同型態?
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁
內容預覽:
給一點想法 我也不知道對不對~@@. try:. A = int('input') #input裡面放你讀進來的值. print 'A is integer' #是數字就輸出是個數字 或者你想對他做甚麼事. except ValueError:. print 'A is string' #如果不是
(還有228個字)
首頁
上一頁
1
下一頁
尾頁