看板
[ Python ]
討論串[問題] 字串的比較與invalid syntax 求助
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁
內容預覽:
1. 布林判斷(True、False)不需要用到「==」或「is」。. 2. 判斷字串相等之類的不要用「is」,請用「==」或「!=」。. 3. 如果文中沒特別打錯,invalid syntax應該只是因為if要小寫。. 可以這樣改. while res != 'c':. if res == 'h'
(還有60個字)
內容預覽:
大家好. 小弟在練習一個猜數字的問題. 其中一段程式如下. res = input("Enter 'h' to indicate the guess is too high. Enter 'l' to. indicate the guess is too low. Enter 'c' to indi
(還有220個字)
首頁
上一頁
1
下一頁
尾頁