Advertisement
simeonshopov

Next happy year 2

Jan 15th, 2020
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. #!/usr/local/bin/python3.7
  2. # -*- coding: utf-8 -*import
  3.  
  4. year = input()
  5. current_year = year
  6. found_year = True
  7.  
  8. while True:
  9.     current_year = int(current_year) + 1
  10.     found_year = True
  11.     for first_index in range(0, len(year)):
  12.         for second_index in range(first_index + 1, len(year)):
  13.             first_digit = str(current_year)[first_index]
  14.             second_digit = str(current_year)[second_index]
  15.             if first_digit == second_digit:
  16.                 found_year = False
  17.                 break
  18.     if found_year:
  19.         print(current_year)
  20.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement