$24
Question 1
1. This code is saved in 3_1.py
2. The program prompts the user to enter a flower’s name, petals and price. Then, it will show it. Then the user can change the flower’s name, petals and price. Then, it will show the updated version.
3. The input name and new name should be string, petals number and new petals number should be integers, price and new price should be float.
4. Execute as followings:
Question 2
1. This code is saved in 3_2.py
2. The program prompts the user to enter a polynomial. Then it will print the first derivative of that polynomial.
3. The input should be a mathematical polynomial which is a string.
4. Execute as followings:
Question 3
1. This code is saved in 3_3.py
2. The program is used to simulate an ecosystem containing two types of creatures, bears and fish. The ecosystem consists of a river, which is modeled as a relatively large list. It prompts the user to enter the river length, the number of fishes, the number of bears and simulation times n. The output will be the state of the river after n times simulation.
3. The input river length, number of fishes, number of bears and simulation times, they all should be positive numbers. And the number of fishes plus the number of bears should smaller than or equal to the river length. If the input does not meet the criteria, the user is
asked to reenter.
4. Execute as followings: