TORONTO KIDS COMPUTER CLUB | PMCA Friday 19:00 Python Homework 10.18.
16613
post-template-default,single,single-post,postid-16613,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

PMCA Friday 19:00 Python Homework 10.18.

23 Oct PMCA Friday 19:00 Python Homework 10.18.

Question 1:

Problem Description
You might be surprised to know that 2013 is the first year since 1987 with distinct digits. The years 2014, 2015, 2016, 2017, 2018, 2019 each have distinct digits. 2012 does not have distinct digits, since the digit 2 is repeated.

Given a year, what is the next year with distinct digits?

Input Specification
The input consists of one integer Y (0 ≤ Y ≤ 10000), representing the starting year.

Output Specification
The output will be the single integer D, which is the next year after Y with distinct digits.

Sample Input 1
1987

Output for Sample Input 1
2013

Sample Input 2
999

Output for Sample Input 2
1023


Question 2:

Please finish writing the following program in order to have proper motheds:

  • __str__
  • __repr__
  • __eq__
  • __lt__

after finish writing the program, you can run the program without error and logically right.

No Comments

Sorry, the comment form is closed at this time.