看板 [ Python ]
討論串[問題]沒頭緒的一個問題...
共 5 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者cccx (ccc)時間15年前 (2010/04/16 00:18), 編輯資訊
0
0
0
內容預覽:
如果不想用 zip 的話. st=input("string:"). pos=input("possition:"). # sort_key: 到st抓c的index 再拿index去pos取位置. sort_key = lambda c: pos[st.index(c)]. sort_st = s

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者KagiJhou (Kagi)時間15年前 (2010/04/13 21:18), 編輯資訊
0
0
2
內容預覽:
試著用3.12的方式寫寫看. st=input("string:"). pos=input("possition:"). z = list(zip(st,pos)). # 指定z是list. z.sort(key= (lambda key:key[1]) ). print ("".join([s[0
(還有156個字)

推噓4(4推 0噓 2→)留言6則,0人參與, 最新作者apua (Apua)時間15年前 (2010/04/11 12:26), 編輯資訊
0
0
0
內容預覽:
幫qsort整理一下,原推應該是寫成如下(丟到編輯器會比較適合閱讀):. # 以下使用python2.x的語法. str=raw_input("string:") # 假設為abc. pos=raw_input("possition:") # 假設為312. z = zip(str,pos). #
(還有325個字)

推噓3(3推 0噓 3→)留言6則,0人參與, 最新作者doghib (lun)時間15年前 (2010/04/11 00:33), 編輯資訊
0
0
0
內容預覽:
inp = raw_input("string: "). position = raw_input("position: "). out = []. for index in range(len(inp)):. out.insert(int(position[index])-1, inp[index

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者lions06 (緣滅)時間15年前 (2010/04/10 22:29), 編輯資訊
0
0
0
內容預覽:
不好意思. 剛剛有發文問過. 有大大回答過. 但我發現他會錯意了. 但還是謝謝. 所以我再發問一次> <. 輸入一字串 例如 abc. 再輸入一串密碼 例如312. a b c. 3 1 2(a放到第3個位置 b放到第1個位置 c放到第2個位置). print的結果. = bca. 不是要. a b
(還有167個字)
首頁
上一頁
1
下一頁
尾頁