Advertisement
sol4r

Python Program for Largest K digit number divisible by X

Aug 7th, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.14 KB | None | 0 0
  1. x = int(input())
  2. k = int(input())
  3. p = []
  4. for i in range(10 ** (k - 1), 10 ** k):
  5.     if i % x == 0:
  6.         p.append(i)
  7. print(p[-1])
  8.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement