Home > other >  Novice python while loop problem for 15 days
Novice python while loop problem for 15 days

Time:09-27

I'm a little don't understand this, I write this code is to realize the input password can use the following code, but finished input and then re-enter, I think I can use to add and subtract, the preceding boot shutdown case I have succeeded, but I just can't figure out why I can't like this, I want to ask for a long time, wish you a great god give me a straightforward explanation

CodePudding user response:

Your AP function return indentation mistake, should not be in the else:, should be aligned with the else

CodePudding user response:

Behind I don't have to def, I directly use the if comparison, finally the same as the above, the reason why I think it is a while

CodePudding user response:

AP (* * *), need you to enter
If the AP (* * *), also need you to enter



Canshu=AP (* * *)
If canshu==1:
Pass
Judgment is the result of the canshu,
Can use at any time

CodePudding user response:

reference day on my reply: 3/f
the AP (* * *) that requires you to enter
If the AP (* * *), also need you to enter



Canshu=AP (* * *)
If canshu==1:
Pass
Judgment is the result of the canshu,
Can use

Is not the problem, the somebody else have input parameters and the indentation, its AP function finally return the indentation is wrong, cause only equal to zero will return, is equal to 1 will only return None,

CodePudding user response:

The code you write is too messy, pay attention to some of the indentation, and the input format code

CodePudding user response:

reference 4 floor Hajo_ response:
Quote: reference day on my reply: 3/f
AP (* * *), need you to enter
If the AP (* * *), also need you to enter



Canshu=AP (* * *)
If canshu==1:
Pass
Judgment is the result of the canshu,
Can use

Is not the problem, the somebody else have input parameters and the indentation, its AP function finally return the indentation is wrong, cause only equal to zero will return, is equal to 1 will only return None,

Yes, I didn't see the problem
  • Related