Skip to content

Instantly share code, notes, and snippets.

@ChristianBagley
Last active September 27, 2017 07:29
Show Gist options
  • Save ChristianBagley/9745d392ec27162478f104cb4b171f17 to your computer and use it in GitHub Desktop.
Save ChristianBagley/9745d392ec27162478f104cb4b171f17 to your computer and use it in GitHub Desktop.
from itertools import permutations
def nextBiggest():
inputNumber = str(input('Enter number: '))
for i in sorted(permutations(str(inputNumber))):
nextNumber = int(''.join(i))
if nextNumber > int(inputNumber):
print(nextNumber)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment