मैं सक्षम नहीं किया गया है करने के लिए बाहर आंकड़ा कैसे करने के लिए पाश वापस अपने कोड के लिए एक विशिष्ट बिंदु पर, मैं 2 पाश अंक और सबसे पहले एक काम करता है ठीक है, लेकिन मैं नहीं कर सकता प्राप्त करने के लिए एक दूसरे काम के रूप में मैं करने के लिए परिभाषित पूर्णांक चर "num_stores_int" लेकिन अगर मैं ऐसा है, तो "while" लूप काम नहीं करता है । मेरे कोड के लिए है, जहां उन बिंदुओं कर रहे हैं.
यहाँ अपने कोड:
num_stores = ("")
num_stores_int = int(num_stores)
while num_stores.isnumeric() == False:
while num_stores_int > 10: #This is where I want it to loop to
num_stores = input ("\n To start, please enter the amount of stores you own: ")
if num_stores.isnumeric() == True:
num_stores_int = int(num_stores)
if num_stores_int > 10: #this is where I want the "while" loop to validate the integer being less than 10
print (" Sorry, this sales tracker can track a maximum of 10 stores.\n Here, try that again, I'll reboot it for you.\n")
print (" -----------------------REBOOTING------------------------")
if num_stores_int >= 5:
print ("\n Hmm, interesting, you'd think someone with that many \n stores would be able to afford a better sales tracker.")
print (" Well, I guess you're stuck with me! MUHAHAHAHA!!......\n\n Anyway,")
print (f" clearly big business person, you own {num_stores_int} stores.\n I'm gonna need you to tell me where each one is")
else:
num_stores_int = int(num_stores)
print (f" Alright... so, random business person, you have {num_stores_int} stores.\n Now, I'm going to need you to tell me where each one is")
else:
print ("\n Hey, uhh, you're going to have to write a number for the\n amount of stores you've got, letters and decimals don't \n really work. Here, try again, I'll reboot it for you.\n")
print (" -----------------------REBOOTING------------------------")