
如圖,我寫了幾段代碼,在編譯的時候,sublime只執行了兩句,感覺根本沒有執行input函式的代碼,請教下是怎么回事
我的sublime哪里配置有問題嗎?
uj5u.com熱心網友回復:
沒人解決小白問題么
uj5u.com熱心網友回復:
發代碼看看 .uj5u.com熱心網友回復:
代碼沒問題的,在idle里都測驗過,能執行,但是在sublime里面 就只執行兩句列印,然后就沒下文了lili=["sex:girl","yuwen:90","shuxue:95"]
lilei=["sex:boy","yuwen:70","shuxue:92"]
student=[] #學生資訊串列---二元串列
student.append(lili) #將學生姓名lili資訊加入學生資訊大串列
student.append(lilei) #將學生姓名lilei資訊加入到學生資訊大串列
student.insert(0,"name:lili") #在學生資訊大串列最開始位置放上lili的名字元素
student.insert(2,"name:lilei")#在學生資訊大串列最開始位置放上lilei的名字元素
lili.append("height:165cm") #給lili增加身高資訊
lilei.append("height:178cm") #給lilei增加身高資訊
while True: #回圈輸入學生資訊
print("請輸入學生資訊:")
name=input("請輸入學生姓名:")
sex=input("請輸入學生性別:")
yuwen=input("請輸入語言成績:")
shuxue=input("請輸入數學成績:")
temp_mes=[] #臨時定義單個學生資訊串列,存放輸入的資訊
#將學生資訊增加到臨時單個學生資訊串列中
temp_mes.append("sex:"+sex)
temp_mes.append("yuwen:"+yuwen)
temp_mes.append("shuxue:"+shuxue)
student.append("name:"+name)
student.append(temp_mes) #將輸入的單個學生資訊放入學生資訊大串列
print("如果學生輸入完畢請按Q,如果沒輸完按任意鍵繼續")
#給出退出回圈機制
temp=input()
if temp=="q":
break
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/258235.html
