arr =
for i in range(5):
print("the names is ",end="")
for j in range(5):
print(arr[j],end=" ")
arr =
for i in range(5):
print("the names is ",end="")
for j in range(5):
print(arr[j],end=" ")
print("") #換行
new_list = arr.sort()
print("the names is ",end="")
for j in range(5):
print(arr[j],end=" ")
arr =
for i in range(5):
for j in range(5):
print(arr[j],end=" ")
print("")#換行
display = int(input("你想顯示第幾個名字,請輸入數字(1-5):"))
print("the %d names is "%display,end="")
print(arr[display - 1])
arr =
for i in range(5):
for j in range(5):
print(arr[j],end=" ")
print("")#換行
changename = int(input("你想改變第幾個名字,請輸入數字(1-5):"))
arr[changename - 1] = input("請輸入你要更換的名字:")
print("please output all name")
print("the names are ",end="")
for k in range(len(arr)):
print(arr[k],end=" ")
print("")
import easygui as gui
******_dic = {}
while 1:
add_or_look = gui.enterbox("add or look up a word.(a/l): ")
if not add_or_look: #在(a/l)介面輸入其他數字結束
break
if add_or_look == "a" or add_or_look == "l":
if add_or_look == "a":
word = gui.enterbox("請輸入你要新增的單詞:")
definition = gui.enterbox("請輸入該單詞的釋義:")
******_dic[word] = definition
gui.msgbox("word added")
else:
look_up_word = gui.enterbox("請輸入要查詢的單詞:")
if look_up_word in ******_dic:
gui.msgbox(******_dic[look_up_word])
else:
gui.msgbox("that word is not in the dictionary yet.")
else:
add_or_look = gui.msgbox("指令不正確,請重新輸入。 ")
python 父與子程式設計之旅 11巢狀與可變迴圈
for multiplier in range 5,8 for i in range 2,11 print i,x multiplier,i multiplier 可變迴圈 numstars int input 請輸入你希望的星 for i in range 1,numstars 1 print 可...
python參考書推薦 父與子的程式設計之旅
之學ython用的是 笨辦法學python 這本書講的很細,但練習分得太細,太繁瑣,光是列印就分了好幾個練習,其實這些小知識點在用的過程中慢慢就記住了,大費周折的有點沒意思。後來在國圖又看見這本 零基礎學python 總共10個練習,可以看到推進得很快,指導性的內容相對少,自己要解決的問題很多,說實...
父與子的程式設計之旅 EasyGui安裝問題解決
在第六章 gui 圖形使用者介面中在按照書中方法 把easygui.py放到python能找到的地方,我放在了python27下 安裝eassygui後,msgbox不能成功執行。import easygui easygui.msgbox hello there traceback most rec...