Valerie is a Shopee user. She really likes buying tech-related stuff. Recently she has been looking to buy a Xiaomi 13, but is not sure which seller to buy from. Using the below dictionary, write a program for Valerie that tallies and displays the total cost of buying a Xiaomi 13 from each seller (including delivery fees and available discounts) then sorts them from least expensive to most expensive, telling her which ones she can afford. She starts with a random amount of money in her account between RM3000 and RM5000.
Valerie must then be able to select which seller she wants to visit and is given the option to buy the product or exit the seller’s page. Visiting a seller’s page clears the previous list from the screen.
If ‘buy’ is chosen, the program must check whether she has enough money in her account. If she does, she’ll be asked for her pin number (the pin number must be 6 digits long and must be a specific permutation of integers). Getting the pin number right will allow her to proceed with the purchase, while getting the pin number wrong more than twice in a row will suspend her account for 365 days. If she doesn’t have enough money, invalidate the purchase.
If ‘exit’ is chosen, the program will clear the screen and return to the previous list.
xm13 = {'Official Xiaomi Store' : {'price' : 2999.0, 'dis%' : 30}, 'Official Siaome Store' : {'price' : 0.99, 'dis%' : 90}, 'mmgbpmall' : {'price' : 3499.0, 'dis%' : 40}, 'spraygadget' : {'price' : 4599.0, 'dis%' : 25}, 'calastore' : {'price' : 1905.0, 'dis%' : 33}, 'mayatech' : {'price' : 2555.0, 'dis%' : 22}, 'mcdecotech' : {'price' : 2359.0, 'dis%' : 20}, 'caviar' : {'price' : 59999.0, 'dis%' : 0}, 'rocketgadgets' : {'price' : 3349.0, 'dis%' : 12}, 'realstore' : {'price' : 20.0, 'dis%' : 50}}