Question: Activity 2 To complete this activity, you need to understand: Lists and List Indexing . Create a Python list with at least five elements of

Activity 2
To complete this activity, you need to understand: Lists and List Indexing .
Create a Python list with at least five elements of different data types (e.g., integer, string, float, etc.).Write a
program that:
Prints the first, third, and last elements of the list.
Exchange the 1 st element with 2 nd element of the list.
Appends a new element to the list.
Prints the modified list.
Print the type of each list element by using list indexing.
Example:
my_list , "hello", 3.14, True, "world"]
Example Output:
First element: 42
Third element: 3.14
Last element: world
Modified List after changing the second element and appending a new one:
["hello",42,3.14, True, "world", "new element"]
"hello" data type:
Activity 2 To complete this activity, you need to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!