Answer to Question #240645 in Python for Licinda Wait

Question #240645
#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-22T23:45:23-0400
levelsList=[1000,2000,3000,4000,5000,6000]
sub_List=[]
for i in levelsList:
    priceLevelLabel='Price Level: '+str(i)
    sub_List.append(priceLevelLabel)
    sub_List.append(i)
print(sub_List)

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