第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

TypeError:列表索引必須是整數(shù)或切片,而不是 str

TypeError:列表索引必須是整數(shù)或切片,而不是 str

慕俠2389804 2022-11-01 14:45:03
過去兩天我一直在嘗試解決此錯誤,但我無法解決。我必須將值(這是一個列表)傳遞給函數(shù),但它說:Typerror :list indices must be integers or slices and not str.這是我的代碼:def input_execute(board, position, mark):    board[position] = markposition = input('enter the position')input_execute(board_items, position, 'x')輸出:enter the position:5如果我輸入它顯示的位置:Typerror :list indices must be integers or slices and not str.
查看完整描述

1 回答

?
慕蓋茨4494581

TA貢獻1850條經(jīng)驗 獲得超11個贊

下面的行返回字符串

position=input('enter the position')

現(xiàn)在將此行更改為

position=int(input('enter the position : '))


查看完整回答
反對 回復 2022-11-01
  • 1 回答
  • 0 關注
  • 99 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號