i want to loop this program from the start again when the input is yes in python The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceExtracting extension from filename in PythonHow do I remove an element from a list by index in Python?Emulate a do-while loop in Python?How do I trim whitespace from a Python string?Python progression path - From apprentice to guruWhy is reading lines from stdin much slower in C++ than Python?How to remove a key from a Python dictionary?Get unique values from a list in pythonPython: How can I store multiple user inputs when using for loop?

First use of “packing” as in carrying a gun

I could not break this equation. Please help me

Why does the Event Horizon Telescope (EHT) not include telescopes from Africa, Asia or Australia?

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

Did God make two great lights or did He make the great light two?

Do working physicists consider Newtonian mechanics to be "falsified"?

How to delete random line from file using Unix command?

What force causes entropy to increase?

Wall plug outlet change

Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?

What's the point in a preamp?

What information about me do stores get via my credit card?

Can a novice safely splice in wire to lengthen 5V charging cable?

When did F become S in typeography, and why?

Mortgage adviser recommends a longer term than necessary combined with overpayments

Windows 10: How to Lock (not sleep) laptop on lid close?

Am I ethically obligated to go into work on an off day if the reason is sudden?

What is this lever in Argentinian toilets?

Is every episode of "Where are my Pants?" identical?

Are my PIs rude or am I just being too sensitive?

"... to apply for a visa" or "... and applied for a visa"?

How to pronounce 1ターン?

Single author papers against my advisor's will?

Take groceries in checked luggage



i want to loop this program from the start again when the input is yes in python



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The Ask Question Wizard is Live!
Data science time! April 2019 and salary with experienceExtracting extension from filename in PythonHow do I remove an element from a list by index in Python?Emulate a do-while loop in Python?How do I trim whitespace from a Python string?Python progression path - From apprentice to guruWhy is reading lines from stdin much slower in C++ than Python?How to remove a key from a Python dictionary?Get unique values from a list in pythonPython: How can I store multiple user inputs when using for loop?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0
















some use is inputting bids on an item and they have a specific buyer number.i can only loop it for bidding on one item.please help me how could i start the program again by asking user in the end if he want to look for another item.




 item_byer=(input("enter the item number 
you want to buy:"))
k=0
for e in (bids_1):
if e==item_byer:
print("item is founded")
break
else:
print("not founded")
k+=1
index_1=(bids_1.index(item_byer))
price=(bids_1[(index_1)+2])
description=(bids_1[(index_1)+1])
print("the price of the item
is,",price)
bids=0
bids=price
print("if you want to enter a bid
please enter this word,bid()")
def bid():
global bids
buyer_num=input("enter your buyer
number!")
highest=input("enter the bid you want
to put on this. make sure it is greater
than previous")
a=0
while int(bids)>int(highest):
print("bids cannot be transfered it
should be greater than current
highest")
highest=input("enter your bid again")
a+=1
if (bids)<(highest):
print("bid accepted")
highest==bids
print("the current highest bid
is",highest)
bids=highest
else:
print("bid denied it should be
greater than the previous")
quit
biding=input("if you want to enter a
bid enter yes ")
if biding=="yes":
bid()
choice=input("if you want to input
another item press yes")









share|improve this question






















  • Read loops, perhaps a while True with a break condition inside.

    – DirtyBit
    Mar 22 at 6:44






  • 3





    Annnd the indentation, Please fix it.

    – DirtyBit
    Mar 22 at 6:45











  • Where is bids_1 defined?

    – DirtyBit
    Mar 22 at 6:47











  • Why do you have break All that could have been summed to just if item_byer in bid_1:

    – DirtyBit
    Mar 22 at 6:48











  • And why do you have k+=1 var when you are not even using it?

    – DirtyBit
    Mar 22 at 6:49

















0
















some use is inputting bids on an item and they have a specific buyer number.i can only loop it for bidding on one item.please help me how could i start the program again by asking user in the end if he want to look for another item.




 item_byer=(input("enter the item number 
you want to buy:"))
k=0
for e in (bids_1):
if e==item_byer:
print("item is founded")
break
else:
print("not founded")
k+=1
index_1=(bids_1.index(item_byer))
price=(bids_1[(index_1)+2])
description=(bids_1[(index_1)+1])
print("the price of the item
is,",price)
bids=0
bids=price
print("if you want to enter a bid
please enter this word,bid()")
def bid():
global bids
buyer_num=input("enter your buyer
number!")
highest=input("enter the bid you want
to put on this. make sure it is greater
than previous")
a=0
while int(bids)>int(highest):
print("bids cannot be transfered it
should be greater than current
highest")
highest=input("enter your bid again")
a+=1
if (bids)<(highest):
print("bid accepted")
highest==bids
print("the current highest bid
is",highest)
bids=highest
else:
print("bid denied it should be
greater than the previous")
quit
biding=input("if you want to enter a
bid enter yes ")
if biding=="yes":
bid()
choice=input("if you want to input
another item press yes")









share|improve this question






















  • Read loops, perhaps a while True with a break condition inside.

    – DirtyBit
    Mar 22 at 6:44






  • 3





    Annnd the indentation, Please fix it.

    – DirtyBit
    Mar 22 at 6:45











  • Where is bids_1 defined?

    – DirtyBit
    Mar 22 at 6:47











  • Why do you have break All that could have been summed to just if item_byer in bid_1:

    – DirtyBit
    Mar 22 at 6:48











  • And why do you have k+=1 var when you are not even using it?

    – DirtyBit
    Mar 22 at 6:49













0












0








0









some use is inputting bids on an item and they have a specific buyer number.i can only loop it for bidding on one item.please help me how could i start the program again by asking user in the end if he want to look for another item.




 item_byer=(input("enter the item number 
you want to buy:"))
k=0
for e in (bids_1):
if e==item_byer:
print("item is founded")
break
else:
print("not founded")
k+=1
index_1=(bids_1.index(item_byer))
price=(bids_1[(index_1)+2])
description=(bids_1[(index_1)+1])
print("the price of the item
is,",price)
bids=0
bids=price
print("if you want to enter a bid
please enter this word,bid()")
def bid():
global bids
buyer_num=input("enter your buyer
number!")
highest=input("enter the bid you want
to put on this. make sure it is greater
than previous")
a=0
while int(bids)>int(highest):
print("bids cannot be transfered it
should be greater than current
highest")
highest=input("enter your bid again")
a+=1
if (bids)<(highest):
print("bid accepted")
highest==bids
print("the current highest bid
is",highest)
bids=highest
else:
print("bid denied it should be
greater than the previous")
quit
biding=input("if you want to enter a
bid enter yes ")
if biding=="yes":
bid()
choice=input("if you want to input
another item press yes")









share|improve this question















some use is inputting bids on an item and they have a specific buyer number.i can only loop it for bidding on one item.please help me how could i start the program again by asking user in the end if he want to look for another item.




 item_byer=(input("enter the item number 
you want to buy:"))
k=0
for e in (bids_1):
if e==item_byer:
print("item is founded")
break
else:
print("not founded")
k+=1
index_1=(bids_1.index(item_byer))
price=(bids_1[(index_1)+2])
description=(bids_1[(index_1)+1])
print("the price of the item
is,",price)
bids=0
bids=price
print("if you want to enter a bid
please enter this word,bid()")
def bid():
global bids
buyer_num=input("enter your buyer
number!")
highest=input("enter the bid you want
to put on this. make sure it is greater
than previous")
a=0
while int(bids)>int(highest):
print("bids cannot be transfered it
should be greater than current
highest")
highest=input("enter your bid again")
a+=1
if (bids)<(highest):
print("bid accepted")
highest==bids
print("the current highest bid
is",highest)
bids=highest
else:
print("bid denied it should be
greater than the previous")
quit
biding=input("if you want to enter a
bid enter yes ")
if biding=="yes":
bid()
choice=input("if you want to input
another item press yes")






python






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 22 at 6:44









Mohammad HamzaMohammad Hamza

1




1












  • Read loops, perhaps a while True with a break condition inside.

    – DirtyBit
    Mar 22 at 6:44






  • 3





    Annnd the indentation, Please fix it.

    – DirtyBit
    Mar 22 at 6:45











  • Where is bids_1 defined?

    – DirtyBit
    Mar 22 at 6:47











  • Why do you have break All that could have been summed to just if item_byer in bid_1:

    – DirtyBit
    Mar 22 at 6:48











  • And why do you have k+=1 var when you are not even using it?

    – DirtyBit
    Mar 22 at 6:49

















  • Read loops, perhaps a while True with a break condition inside.

    – DirtyBit
    Mar 22 at 6:44






  • 3





    Annnd the indentation, Please fix it.

    – DirtyBit
    Mar 22 at 6:45











  • Where is bids_1 defined?

    – DirtyBit
    Mar 22 at 6:47











  • Why do you have break All that could have been summed to just if item_byer in bid_1:

    – DirtyBit
    Mar 22 at 6:48











  • And why do you have k+=1 var when you are not even using it?

    – DirtyBit
    Mar 22 at 6:49
















Read loops, perhaps a while True with a break condition inside.

– DirtyBit
Mar 22 at 6:44





Read loops, perhaps a while True with a break condition inside.

– DirtyBit
Mar 22 at 6:44




3




3





Annnd the indentation, Please fix it.

– DirtyBit
Mar 22 at 6:45





Annnd the indentation, Please fix it.

– DirtyBit
Mar 22 at 6:45













Where is bids_1 defined?

– DirtyBit
Mar 22 at 6:47





Where is bids_1 defined?

– DirtyBit
Mar 22 at 6:47













Why do you have break All that could have been summed to just if item_byer in bid_1:

– DirtyBit
Mar 22 at 6:48





Why do you have break All that could have been summed to just if item_byer in bid_1:

– DirtyBit
Mar 22 at 6:48













And why do you have k+=1 var when you are not even using it?

– DirtyBit
Mar 22 at 6:49





And why do you have k+=1 var when you are not even using it?

– DirtyBit
Mar 22 at 6:49












1 Answer
1






active

oldest

votes


















2














Since there are so many things wrong with that but sticking to your originally asked question: how could i start the program again by asking user in the end if he want to look for another item.



You could put your working code in a loop and take user input in the end, perhaps:



bids_1 = ['some', 'list', 'of', 'OP']

while True:
item_ = input("enter the item number you want to buy: ")
if item_ in bids_1:
print("item is found")
else:
print("item not found")
userInp = input("Do you want to check for another item? Press Y to continue: ")
if userInp.upper() != 'Y':
break





share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55294219%2fi-want-to-loop-this-program-from-the-start-again-when-the-input-is-yes-in-python%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Since there are so many things wrong with that but sticking to your originally asked question: how could i start the program again by asking user in the end if he want to look for another item.



    You could put your working code in a loop and take user input in the end, perhaps:



    bids_1 = ['some', 'list', 'of', 'OP']

    while True:
    item_ = input("enter the item number you want to buy: ")
    if item_ in bids_1:
    print("item is found")
    else:
    print("item not found")
    userInp = input("Do you want to check for another item? Press Y to continue: ")
    if userInp.upper() != 'Y':
    break





    share|improve this answer





























      2














      Since there are so many things wrong with that but sticking to your originally asked question: how could i start the program again by asking user in the end if he want to look for another item.



      You could put your working code in a loop and take user input in the end, perhaps:



      bids_1 = ['some', 'list', 'of', 'OP']

      while True:
      item_ = input("enter the item number you want to buy: ")
      if item_ in bids_1:
      print("item is found")
      else:
      print("item not found")
      userInp = input("Do you want to check for another item? Press Y to continue: ")
      if userInp.upper() != 'Y':
      break





      share|improve this answer



























        2












        2








        2







        Since there are so many things wrong with that but sticking to your originally asked question: how could i start the program again by asking user in the end if he want to look for another item.



        You could put your working code in a loop and take user input in the end, perhaps:



        bids_1 = ['some', 'list', 'of', 'OP']

        while True:
        item_ = input("enter the item number you want to buy: ")
        if item_ in bids_1:
        print("item is found")
        else:
        print("item not found")
        userInp = input("Do you want to check for another item? Press Y to continue: ")
        if userInp.upper() != 'Y':
        break





        share|improve this answer















        Since there are so many things wrong with that but sticking to your originally asked question: how could i start the program again by asking user in the end if he want to look for another item.



        You could put your working code in a loop and take user input in the end, perhaps:



        bids_1 = ['some', 'list', 'of', 'OP']

        while True:
        item_ = input("enter the item number you want to buy: ")
        if item_ in bids_1:
        print("item is found")
        else:
        print("item not found")
        userInp = input("Do you want to check for another item? Press Y to continue: ")
        if userInp.upper() != 'Y':
        break






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 22 at 7:01

























        answered Mar 22 at 6:56









        DirtyBitDirtyBit

        13.3k41943




        13.3k41943





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55294219%2fi-want-to-loop-this-program-from-the-start-again-when-the-input-is-yes-in-python%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript