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

期中考筆試重點

  • FONT字型,EM=EMPHASIZE強調。撰寫模式,方便,不專業藉由複習HTML,JAVASCRIPT等,可以順便讓你們了解PYTHON的特色
  • .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元組
  • 角括號<>ANGLE BRACKET,不能直接打角括號,因為它們是HTML命令,需用&符號接LT(小於Less Then)再分號;
  • 圓周CIRCUMFERENCE, 直徑DIAMETER, 半徑RADIUS BORDER邊界, SOLID實心, PX=PIXEL點 
  • PYTHON與JAVASCRIPT命令的對照,PYTHON必須透過編輯器或雲端伺服器(例如GOOGLE COLAB)執行,JAVASCRIPT可以直接在瀏覽器CHROME或EDGE執行 
  • PYTHON指令len(串列)對比JAVASCRIPT串列.length; 
  • PYTHON指令串列.append(新增)對比JAVASCRIPT串列.push(新增);傳列.pop()移除最後一個元素
  • BUTTON的ONCLICK事件=按下按鈕執行...以最後一個為例,執行kill()

執行JAVASCRIPT的串列迴圈:全球市場價值最大的銀行

CSS也可以in-line

以上指令給甲班同學參考

<button onclick="ABC()">全球市場價值最大的銀行</button>
<button onclick="XYZ()">按鈕BUTTON push</button>
<button onclick="kill()">pop刪除最後一項</button>
<P id="SHOW" style="BACKGROUND-COLOR:PINK; FONT-SIZE:24PX;"></P>
CSS也可以in-line
<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('三菱銀行') //加入push
 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;
}
function kill()
{ banks.pop();//可以全放一起,方便閱讀,分行,侯來python分行當作命令,不用{}
  }
</script>

留言

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

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

    回覆刪除
  3. https://djhdvdhd.blogspot.com/2025/03/blog-post_11.html

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

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

    回覆刪除
  6. https://huangyunchieh.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  7. https://zzy-hn.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  8. https://wwersseraaer.blogspot.com/2025/03/pythonlistarray.html

    回覆刪除
  9. https://www.blogger.com/blog/post/edit/preview/298840322514420979/8308553312492675769

    回覆刪除
  10. https://lu-chieh-chi.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  11. https://jiang-jia-ehen.blogspot.com/2025/03/buttononclick-button-push-banks.html

    回覆刪除
  12. https://anson0501.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

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

    回覆刪除
  14. https://egdvcn-gh.blogspot.com/2025/03/blog-post.html

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

    回覆刪除
  16. https://guovupvmp.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  17. https://shanny11336108.blogspot.com/2025/03/pythonlist.html

    回覆刪除
  18. https://lintingyang11317134.blogspot.com/2025/03/buttononclick-button-push-banks.html

    回覆刪除
  19. https://xin00.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  20. https://chang-yam-ci.blogspot.com/2025/03/blog-post.html

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

    回覆刪除
  22. https://ericfggf554466.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  23. https://wihfaw.blogspot.com/2025/03/youtube-video-player.html

    回覆刪除
    回覆
    1. 幹得很好,但你可以做得更完美,讓他有css功能。https://wihfaw.blogspot.com/2025/03/youtube-video-player.html

      刪除
  24. https://jiang233.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

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

    回覆刪除
  26. https://xiyuying.blogspot.com/2025/03/animal-pythoncomments-printanimal2.html

    回覆刪除
  27. https://d11317145.blogspot.com/2025/03/onclickabc-onclickxyz-push-idshow-banks.html

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

    回覆刪除
  29. https://zhuo-you-wen.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  30. https://yezonghan.blogspot.com/2025/03/fontememphasize.html

    回覆刪除
  31. https://ting950214.blogspot.com/2025/03/buttononclick-button-push-banks.html

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

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

    回覆刪除
  34. https://sklnfijseifjsk.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  35. https://huangchenyang.blogspot.com/2025/03/blog-post_11.html

    回覆刪除
  36. https://yichen0617.blogspot.com/2025/03/pythonlistarraytuplesetdic.html

    回覆刪除
  37. https://h5ying.blogspot.com/2025/03/h1background-colorpinkcolorwhiteulborde.html

    回覆刪除
  38. https://allyking097.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
    回覆
    1. 完美執行。https://allyking097.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

      刪除
  39. https://leelittle25147.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除
  40. https://xie-ni.blogspot.com/2025/03/pythonlistarraytuplesetdict.html

    回覆刪除

張貼留言

這個網誌中的熱門文章

劉任昌PYTHON陣列ARRAY串列LIST字典DIC集合SET元組TUPLE

劉任昌Javascript與Python比較