Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
need solution to code
#6
I think I got what you want. let me know does it work.
batch_list = ["batch number", "no of components"]
component_list = ["Winglet Strut A320 Series", "Winglet Strut A380 Series", "Door Handle A320 Series",
                   "Door Handle A380 Series", "Rudder Pin A320 Series", "Rudder Pin A380 Series"]
 
 
input_list = ["1", "2", "3", "4", "5", "6"]
p1 = input("select a meterial: ")
 


try:
  if p1 == "1":
        print("you have selected 1")
        
  elif p1 == "2":
        print("you have selected 2")
  elif p1 == "3":
        print("you have selected 3")
  elif p1 == "4":
        print("you have selected 4")
  elif p1 == "5":
        print("you have selected 5")
  elif p1 == "6":
        print("you have selected 6")
  else:
    raise ValueError 
except ValueError:
  print("Oops!  That was no valid number.  Try again...")
Reply


Messages In This Thread
need solution to code - by mccluregamer4472 - Feb-23-2019, 02:00 AM
RE: need solution to code - by Larz60+ - Feb-23-2019, 02:39 AM
RE: need solution to code - by mccluregamer4472 - Feb-23-2019, 04:03 PM
RE: need solution to code - by Larz60+ - Feb-23-2019, 04:54 PM
RE: need solution to code - by mccluregamer4472 - Feb-23-2019, 04:59 PM
RE: need solution to code - by manish1m97 - Feb-23-2019, 05:01 PM
RE: need solution to code - by Larz60+ - Feb-23-2019, 05:57 PM
RE: need solution to code - by mccluregamer4472 - Feb-23-2019, 06:26 PM
RE: need solution to code - by mccluregamer4472 - Feb-27-2019, 11:12 AM
RE: need solution to code - by mccluregamer4472 - Mar-04-2019, 12:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  please looking for typo in my code (solution please) jamie_01 1 1,957 Jan-12-2022, 06:45 AM
Last Post: Gribouillis
  Newbie - code solution explained Stjude1982 2 2,716 Sep-16-2021, 08:54 AM
Last Post: Stjude1982
  Quick Help - Timers - Need Small Solution for Working Code EwH006 5 5,514 Nov-17-2020, 04:09 AM
Last Post: EwH006
  Multiplication Recursive Solution - What's Going On Inside the Code? emerger 1 3,286 Mar-04-2018, 07:11 AM
Last Post: ka06059
  Question on babynames.py solution code? Athenaeum 3 5,476 Feb-20-2018, 06:20 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020