Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d49867e

Browse files
authored
Solution
1 parent 257e85e commit d49867e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

‎HackerRank-Find Digits/Find_Digits.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/python3
2+
3+
import math
4+
import os
5+
import random
6+
import re
7+
import sys
8+
9+
# Complete the findDigits function below.
10+
def findDigits(n):
11+
count = 0
12+
print(list(str(n)))
13+
for i in list(str(n)):
14+
if int(i) != 0 and n % int(i) == 0:
15+
count += 1
16+
return count
17+
18+
if __name__ == '__main__':
19+
fptr = open(os.environ['OUTPUT_PATH'], 'w')
20+
21+
t = int(input())
22+
23+
for t_itr in range(t):
24+
n = int(input())
25+
26+
result = findDigits(n)
27+
28+
fptr.write(str(result) + '\n')
29+
30+
fptr.close()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /