黃晨陽

利用w3schools練習的python指令

animal = ["豬", "牛", "羊", '貓', "蛇"]
#python語言的註解comments,以下命令出現
print(animal[2])
print(animal[-5])
for i in range(5):#其他語言{}代表一個區
  x = '我愛' + animal[i]
  print(x) #使用index
print('上面使用index, 下面沒用')
for i in animal:
  print(i)
x = animal.copy()
print(animal)
x.reverse() #將x反轉reverse
print(x)
animal.append('狗')
print(animal)
y = animal.copy()
y.reverse() #將x反轉reverse
print(y) 

留言

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

    回覆刪除
  2. 3月4日https://huangchenyang.blogspot.com/2025/03/blog-post.html
    將它做完整。https://huangchenyang.blogspot.com/2025/02/blog-post.html

    回覆刪除

張貼留言

這個網誌中的熱門文章

黃晨陽Python_Javascript網路執行_EXCEL_IRR二分法

python tkinter create_line利用tkinter繪圖