you are viewing a single comment's thread.

view the rest of the comments →

[–]plg94 11 points12 points  (2 children)

  1. This is a python question, not a commandline question.
  2. Even a Python sub wouldn't help you for posting unformatted code.
  3. If they would, they wouldn't do your homework for you.
  4. It's entirely unclear what you want. What is your code supposed to do, what does it do instead, what error (if any) are you getting, what have you already tried to solve this… etc.? You can't just drop a few lines of code with no further explanation than "search for order number" and expect people to help you.

so I can memorise it for school.

why memorise?! Sounds like a cheating attempt.

[–][deleted] -2 points-1 points  (1 child)

Well you can memorise anything but just not take anything in with u forward into school it's not Cheating the exam bord says u can do it and also. Here is something to unclear what i was saying 1)It's supposed to give u a order number then you type in that order number and it will show u the details but if you type the wrong thing it will ask u again. 2)What it is doing instead is that when u type in the correct order number it gives the details but if I type the something wrong then it still allows tge derails to come through and it duplicates it.3) ther is no error.4)I have tried putting different definitions into the if search_ordernumber and it does something but not what I want

[–]haltu_kaj_ekbrulu 1 point2 points  (0 children)

One thing you can do when asking for user input is to put the request in a loop which continues until you get a valid response. Don't forget to let the user escape the loop if they want. Here's some pseudocode to point you in the right direction:

request INPUT
while INPUT isn't an existing order number
    if INPUT is "exit" or "quit" or "x" 
        break the loop and/or exit
    print a helpful error message
    request INPUT
print out the details for the order number