Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def digitsProduct(product):
- x = 0
- y = 0
- amount = 1
- if product == 0:
- return 10
- while (x <= 10000):
- string = str(x)
- string_length = len(string)
- while (y < string_length):
- amount = amount * int(string[y])
- y = y + 1
- if amount == product:
- return int(string)
- x = x + 1
- y = 0
- amount = 1
- return -1
Advertisement
Add Comment
Please, Sign In to add comment