I have a problem with if and else statements.
I wrote the following script:
def questionscp():
stateanswer = raw_input('Do you want to change device state? (y/n): ')
if stateanswer == 'y':
choosestate = raw_input('Choose Device State(0=Hibernate, 1=Power Save, 2=Safe Mode, 3=Operating Mode, 4=Diagnostic Mode, 5=Remote Power Off): ')
client.write_register(64, choosestate, 70)
else:
return
activewarningflag = raw_input('Activate warning flag?? (y/n): ')
if activewarningflag == 'y':
client.write_register(67, 1, 70)
else:
return
The problem is that I want the script will ask the second question (activewarningflag) after the first one, even if 'n' is chosen, but in the else statement I put "return" cause Im new to do this and dont know a lot yet. What can I write instead of "return" if I want the function to continue to read itself?
thanks