Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- components = ("Processor",
- "RAM",
- "Storage",
- "Screen",
- "Case",
- "USB ports")
- choices = ("P3",
- "P5",
- "P7",
- "16GB",
- "32GB",
- "1TB",
- "2TB",
- "19\"",
- "23\"",
- "Mini Tower",
- "Midi Tower",
- "2 ports",
- "4 ports")
- prices = (100, 120, 200, 75, 150, 50, 100, 65, 120, 40, 70, 10, 20)
- def choose_set(component, choice, price):
- print("Your choice was: ", components[component], choices[choice], prices[price])
- def output_processor_info():
- #output for user
- print("Processors")
- print("Your choices are: ")
- for choice in choices[:3]:
- print(choice)
- print("The prices are: ")
- for price in prices[:3]:
- print(price)
- def choose_processor():
- #create a sublist of processors formatted to lowercase
- processors = []
- for processor in choices[:3]:
- processors.append(processor.lower())
- #input validation
- processor_choice = input("Make your choice: ")
- while processor_choice.lower() not in processors:
- print("That is not a valid choice.")
- processor_choice = input("Please choose again: ")
- print()
- return processor_choice
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement