write the python code please step by step
Animals1=["Dog","Turtle","Rabbit","Parrot","Cat"]
Animals2=["Mouse","Fish","Hamster","Lion"]
List3=[80, 30, 15, 32, 93]
6) insert "Eagle" as third element into Animals2 list
7) merge the two lists using extend() method
8) delete "Rabbit" from Animals1
9) remove the last element from Animals2
10) print Animals1 list using for loop
11) print Animals2 list using while loop
12) create a new list called Animals3 using list comprehension
and including elements from
Animals1 list encluding letter 'e'
13) create a new list called Animals4 using list comprehension
and returning all elemenets from
Animals2 but returning "Elephant" instead of "Hamster".
14) sort List3 based on how close the number is to 30
15) reverse list Animals2 regardless of the alphabet.
16) merge lists Animals2 and List3 using append() method
17) merge lists Animals1 and List3 using extend() method
18) merge lists Animals1 and Animals2 using '+' operator.
19) delete the third element from List3
20) delete the whole list Animals1.
21) If "Rabbit" exists in Animals1 list then display "The list
contains Rabbit".
22) If "Eagle" exists in Animals1 list then display "The list
does not contain Eagle".
I'll give you big thumbs up if you help me thx.
write the python code please step by step Animals1=["Dog","Turtle","Rabbit","Parrot","Cat"] Animals2=["Mouse","Fish","Ha
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am