Answered step by step
Verified Expert Solution
Question
1 Approved Answer
# Create a list with the names of your group members as string literals. It should look similar to example_listl. group members = []
# Create a list with the names of your group members as string literals. It should look similar to example_listl. group members = [] # YOU FILL THIS IN print("My group members are: ") print (group_members) # Now try creating a list with variables instead of literals, similar to how we defined x, y, and z in the cell above. group member1 = " " group member2 = '' group member3 = group member4 = 11 group members = [] # YOU FILL THIS IN # Use indexing to print your own name from group members. The output should look like: I am John Smith print() # YOU FILL THIS IN group members are: Let's look at how lists can be updated. Using the list in the next code box, we can update the values with the following methods. #use this list! elements_list = ["earth", "air", "fire", "water"] Replacing: Replace a value at index i by overwriting the variable assignment. In the next code box, replace "fire" with "lightning" and output the resulting list. Hint: Use the index function to find where the string is in the list and then use the [] notation to access and replace the value at that index. This frees you from finding the index manually. # Replace fire with lighting here. Be sure to run the code cell above to have elements_list defined # so that it can be recognized by your code.
Step by Step Solution
★★★★★
3.67 Rating (180 Votes )
There are 3 Steps involved in it
Step: 1
Heres the corrected code with instructions Create a list with the names of your group members as string literals groupmembers John Sara David Emily pr...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started