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

利用W3school練習的python指令

animal = ["豬", "牛", "羊", '貓']
#python語言的註解comments
x = animal.copy()
print(animal)
x.reverse() #將x反轉reverse
print(x)
animal.append('狗')
print(animal)
y = animal.copy()
y.reverse() #將x反轉reverse
print(y)

留言

這個網誌中的熱門文章

葉宗翰JAVASCRIPT與PYTHON比較

葉宗翰STYLE與SCRIPT放在HTML後

葉宗翰學習brocode