Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Changing value by index | Lists
Python Ninja (copy - for upload test)
セクション 7.  2
ninja.py

ninja.py

index.html

index.html

preset.py

preset.py

Changing value by index

メニューを表示するにはスワイプしてください

In this chapter, we will learn how to change the value of a list element using its index in Python. To modify a specific element, access the list at the desired index and assign it a new value. For example:

123456789
# Existing list inventory = ["cat", "dog", "chicken", "monkey"] # Change the second element inventory[1] = "parrot" # inventory is now ["cat", "parrot", "chicken", "monkey"] print(inventory)

You can also change an item in the ninja's inventory by index. To do this, you can pass the index to the ninja.pick_to_inventory(index) method.

ninja.py

ninja.py

タスク

スワイプしてコーディングを開始

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 7.  2
ninja.py

ninja.py

index.html

index.html

preset.py

preset.py

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt