Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
need solution to code
#10
this is what i have so far

class batch:
    def _init_(self, batch_number, components_in_batch):
        self.batch_number = batch_number
        self.components_in_batch = components_in_batch

class component:
    def _init_(self, type, size):
        self.type = type
        self.size = size

    components_list = ["1 = Winglet Strut", "2 = Door Handle", "3 = Rudder Pin"]
    print(components_list)
def chosen_component():
    print()
def chosen_size():
    print()

print("please select an option")#
print("1 = create a batch")
print("0 = exit")
while True:
    choice = input("> ")
    if choice == '1':
        print("welcome to the program")
        #batch_number = batch_number + 1
        #print("batch number is " + (currentDT.strftime("%d%m%y") + str(batch_number).zfill(4))
        break
    elif choice == '0':
        print("you have selected to exit program")
        break
    else:
        print("invalid choice")
    print()

while True:
    print("what component?")
    component = input("> ")
    if component == '1':
        print("you have selected Winglet Strut.")
        chosen_component == 'component'
        break
    elif component == '2':
        print("you have selected Door Handle")
        chosen_component == 'component'
        break
    elif component == '3':
        print("you have selected Rudder Pin")
        chosen_component == 'component'
        break
    else:
        print("invalid choice")


sizes_list = ["1 = A320 Series", "2 = A380 Series"]
print(sizes_list)
while True:
    print("Please select the size of the of the component")
    size = input("> ")
    if size == '1':
        print("you have selected the A320 Series")
        chosen_size == 'size'
        break
    elif size == '2':
        print("you have selected the A380 Series")
        chosen_size == 'size'
        break
    else:
        print("invalid choice")


while True:
    if chosen_component == 1 and chosen_size == 1:
        print("you have selected Winglet Strut A320 Series")
        break
    elif chosen_component == 1 and chosen_size == 2:
        print("you have selected Winglet Strut A380 Series")
        break
    elif chosen_component == 2 and chosen_size == 1:
        print("you have selected Door Handle A320 Series")
        break
    elif chosen_component == 2 and chosen_size == 2:
        print("you have selected Door Handle A380 Series")
        break
    elif chosen_component == 3 and chosen_size == 1:
        print("you have selected Rudder Pin A320 Series")
        break
    elif chosen_component == 3 and chosen_size == 2:
        print("you have selected Rudder Pin A380 Series")
        break
    else:
        print("invalid process")
    break
i need to create the batch number still, ive tried a few solutions but it hasnt worked and i also need the final while loop to work as it needs to read from the 2 previous outputs to get its information
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,270 Jan-12-2022, 06:45 AM
Last Post: Gribouillis
  Newbie - code solution explained Stjude1982 2 1,840 Sep-16-2021, 08:54 AM
Last Post: Stjude1982
  Quick Help - Timers - Need Small Solution for Working Code EwH006 5 4,032 Nov-17-2020, 04:09 AM
Last Post: EwH006
  Multiplication Recursive Solution - What's Going On Inside the Code? emerger 1 2,620 Mar-04-2018, 07:11 AM
Last Post: ka06059
  Question on babynames.py solution code? Athenaeum 3 4,472 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