Answer to Question #242682 in Python for Yami

Question #242682

# Create displayList

displayList = []


# Loop through the prices in levelsList.

# During each loop:

# - Create a variable called priceLevelLabel consisting of the text 'Price Level: ' followed

# by the price.

# - Add priceLevelLabel and the price as two separate items to a new list (the sub-List).

# - Append the sub-List to displayList.

for price in self.levelsList:

...


1
Expert's answer
2021-09-27T02:59:16-0400
displayList=[]
levelsList=[3,4,5,6,7,85,34]


for i in range(0,len(levelsList)):
    subList=[] 
    priceLevelLabel=["Price Level",levelsList[i]]
    spacePrice=' '.join(map(str, priceLevelLabel))
    print(spacePrice)
    subList.append(spacePrice)
    displayList.append(subList)
print(displayList)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS