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
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 eg integer, string, float, etc.Write a
program that:
Prints the first, third, and last elements of the list.
Exchange the st element with 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:
mylist "hello", True, "world"
Example Output:
First element:
Third element:
Last element: world
Modified List after changing the second element and appending a new one:
hello True, "world", "new element"
"hello" data type:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
