29 Aug Summer Camp 2021 Python Homework 15:00 – week 07
Question 1:
Continue modify the war-robot program we made in the class, so that:
- it will be the enemy’s turn to strike you back. Enemy can only use gun to fire and cause damage between 50-90.
- after enemy’s turn, if your hp is lower or equal to 0, use msgbox to display message ‘you lose’, and the while program finish.
Question 2:
We have a list of following:
zoo = ['monkeys', 'tigers', 'pandas', 'penguins', 'giraffes', 'hippos', 'bears']
how to retrieve a slice of list zoo, so you can get the following results?
['tigers', 'pandas', 'penguins', 'giraffes'] ['hippos', 'bears']
Question 3:
- Create a list called “attributes” , it contains “HP”, “Attack”, “Defense”, “Special Attack”, “Special Defense”, “Speed”
- Modify the list above, replace “Special Attack” and “Special Defense” with “Magic” and “Stamina”
- Add “Special skills” in the end of the list
- Delete “Speed” from the list.
- Insert “Special Attack” and “Special Defense” just before “Special skills”
Sorry, the comment form is closed at this time.