Question: Need Help to add code that will insert a new element in the list of lists #import random module to randomly choose an option import

Need Help to add code that will insert a new element in the list of lists
#import random module to randomly choose an option
import random
#list of lists of available clothing
clothing_list=["hat",["white socks", "black socks"],["red shirt", "greenshirt"],["jeans", "dress pants", "pajama pants"]]
#print the entire list
print(clothing_list)
#assign headwear a list within the list
headwear=clothing_list[0]
#print headwear list
print(headwear)
#assign socks a list within the list
socks=clothing_list[1]
#print socks list
print(socks)
#assign shirt a list within the list
shirts=clothing_list[2]
#print shirt list
print(shirts)
#assign pants a list within the list
pants=clothing_list[3]
#print pants list
print(pants)
#randomly choose a sock color
sock_choice=random.choice(socks)
#randomly choose a shirt color
shirt_choice=random.choice(shirts)
#randomly choose a pants option
pants_choice=random.choice(pants)
#print a chosen outfit
print(headwear, sock_choice,shirt_choice, pants_choice)Ne

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 Databases Questions!