Hi y’all I’m working on a problem we have to design a program that takes as input a 9 digit number where no digit appears twice and produces as output an arrangement of the same 9 digits corresponding to the next highest number. So for example if the input is 781623954 the output would be 781624359.

My code below runs infinitely while displaying only a +1 number (for eg if I input 781623954 it will repeat 781623955 9 times then repeat 781623960 9 times). I’ve written my logic for each line below but can’t find where I went wrong. Can anyone let me know which part of my logic is wrong?

```
#User's input number, define variables
user_input= input("write a nine digit number without repeating any digit: ")
candidate= int(user_input)+1
found= True
#as long as each digit of candidate can be found in user input number...
while found:
#assign digit to each number in candidate as it
#goes through loop for each number in candidate
for digit in str(candidate):
#what has to happen in order for candidate to be false.
if digit not in user_input:
found = False #Needs to be false so the loop keeps running?
#for loop keeps going for each number in user_input
else:
found= True #Is this necessary?
print("The number is", candidate)
#Add one to try the next candidate
candidate=candidate+1
```