劉任昌python串列List(陣列Array),元組Tuple,集合Set,字典Dict

EMBED嵌入影片522

EMBED DIAMOND手環嵌入鑽石

期中考筆試重點

  • .SELECTOR{用在多個元素},SPAN拇指與小指的距離,一小段,一小段的文字
  • UL=UNDERER LIST, OL=ORDERED LIST, LI=LIST
  • push推,美國餐廳放置餐盤的架子下面是彈簧,取盤子pop,放入盤子push
  • append附加在後面, appendix書本的附錄
  • 大括號{ }CURLY BRACKET, CURLY捲,用於PYTHON集合
  • 中括號[ ]SQUARE BRACKET, SQUARE方形,用於PYTHON串列
  • 小括號( )CIRCLE BRACKET, CIRCLE圓,用於PYTHON元組
  • 角括號<>CORNER BRACKET,不能直接打角括號,因為它們是HTML命令,需用&符號接LT(小於Less Then)再分號;
  • 圓周CIRCUMFERENCE, 直徑DIAMETER, 半徑RADIUS
  • BORDER邊界, SOLID實心, PX=PIXEL點
  • PYTHON與JAVASCRIPT命令的對照,PYTHON必須透過編輯器或雲端伺服器(例如GOOGLE COLAB)執行,JAVASCRIPT可以直接在瀏覽器CHROME或EDGE執行
    1. PYTHON指令len(串列)對比JAVASCRIPT串列.length;
    2. PYTHON指令串列.append(新增)對比JAVASCRIPT串列.push(新增);

以上程式碼在html模式貼在最下面

<BUTTON ONCLICK='ABC()'>按鈕BUTTON按下去的事件ONCLICK</BUTTON>
<BUTTON ONCLICK='XYZ()'>按鈕BUTTON push</BUTTON>
<P ID='SHOW'></P>
<SCRIPT>
banks=['摩根大通','美國銀行','中國工商','富國銀行'];
function ABC()
  {
//javascript註解//python註解#
//python使用內縮固定字元當作同一區段,其他語言使用{...}
let x = '';//定義字串x內容空白
for (let i in banks)//javascript for loop () python不需要
   { x += banks[i] + '<BR>';} //x後面加上banks[0]....<>
document.getElementById('SHOW').innerHTML = x;}
function XYZ()
{ banks.push('Mitsubishi Banks')
 let x = '';//定義字串x內容空白
let n = banks.length; //n儲存banks串列list的長度length
for (let i=0; i < n; i++)//javascript for loop () python不需要
   { x += banks[i] + '<BR>';} //x後面加上banks[0]....<>
document.getElementById('SHOW').innerHTML = x;
}
</SCRIPT>

留言

  1. https://chenyenhsun.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  2. https://lin-yujing.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  3. https://ypayupinan.blogspot.com/2025/03/pythonarraylistdicsettuple.html

    回覆刪除
  4. https://gbsddik.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  5. https://sccabout.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  6. https://jiachiangkuo.blogspot.com/2025/03/311.html

    回覆刪除
  7. https://huuiiiiman.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  8. https://mumeng-ru.blogspot.com/2025/03/blog-post.html

    回覆刪除
  9. https://christina-lqw.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  10. https://www.blogger.com/blog/post/edit/4464279054550040617/2058938356541193853?hl=zh-TW

    回覆刪除
    回覆
    1. 也可以採取偷懶的方法,在撰寫模式貼上,就會有格式。https://tzuchenchu.blogspot.com/2025/03/pythonlistarraytuplesetdict.html
      這一題應該在HTML模式貼上。https://tzuchenchu.blogspot.com/2025/03/202534python-array.html
      計算機完美執行https://tzuchenchu.blogspot.com/2025/02/cchatgpt.html

      刪除
  11. https://pei940922.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除

  12. https://sincewayne.blogspot.com/2025/03/blog-post.html

    回覆刪除
  13. https://zhuo-1005.blogspot.com/2025/03/blog-post_10.html

    回覆刪除
  14. https://yuweiiiiiiiiiiii.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  15. https://vovo8564513.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  16. https://huutingyu.blogspot.com/2025/03/pythonlistarraytuplesetdict-3-10-2025.html

    回覆刪除
  17. https://xu-bing-wei-0804.blogspot.com/2025/03/311.html

    回覆刪除
  18. https://slu804387.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  19. https://xuan-ang.blogspot.com/2025/03/phthonjavascript.html

    回覆刪除
  20. https://chiuerya0515.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  21. https://takuto20050803.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  22. https://acdhdwstzws.blogspot.com/2025/03/pythonlistarraytuplesetd.html

    回覆刪除
  23. https://takming123.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  24. https://winnielee0311.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  25. https://yangyami.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  26. https://zyixnn.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  27. https://linchengxun.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  28. https://chenwewen.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  29. 作者已經移除這則留言。

    回覆刪除
    回覆
    1. 巴黎銀行,超級宇宙無敵優秀的你,應該去當總裁https://lupeiying.blogspot.com/2025/03/pythonlistarraytuplesetdict-3-10-2025.html
      Colab.https://lupeiying.blogspot.com/2025/03/pythonarraylistdicsettuple.html
      計算機確實可以執行https://lupeiying.blogspot.com/2025/03/chatgpt.html
      3月4日豬牛羊https://lupeiying.blogspot.com/2025/03/2025python-array.html

      刪除
  30. https://huangchenyang.blogspot.com/2025/03/blog-post_11.html

    回覆刪除
    回覆
    1. 巴黎銀行等著你去當總裁。https://huangchenyang.blogspot.com/2025/03/blog-post_11.html

      刪除
    2. 3月4日https://huangchenyang.blogspot.com/2025/03/blog-post.html

      刪除
  31. https://zhou-wei-ling.blogspot.com/2025/03/javasciptpython.html

    回覆刪除
  32. https://d11117315111.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  33. https://chan0528.blogspot.com/2025/04/pythonlistarraytuplesetdict.html

    回覆刪除
  34. https://yangyoyo0125.blogspot.com/2025/04/pythonlistarraytuplesetdict.html

    回覆刪除
  35. https://d11117242.blogspot.com/2025/04/pythonlistarraytuplesetdict.html

    回覆刪除

張貼留言

這個網誌中的熱門文章

2025年3月4日上課Python 陣列array串列的函數(方法)

劉任昌Javascript物件導向Python物件導向