+ 1
Exactly k non zero digits
program must print the integers from x to y having exactly k non zero digits x,y,k=map(int,input().split()) for i in range(x,y+1): while i>0: count=0 a=i%10 if a!=0: count+=1 i=i//10 if count==k: print(i,end=' ') Input: 100 200 2 expected output: 101 102 103 104 105 106 107 108 109 110 120 130 140 150 160 170 180 190 but I am not getting any output Is my code correct?
5 Answers
+ 1
Understood
Thanksπ€©
ππ’π’ππ¨ ππ‘ππ²ππ₯
0
ππ’π’ππ¨ ππ‘ππ²ππ₯
I've edited now
0
ππ’π’ππ¨ ππ‘ππ²ππ₯
Great , the above code passed
Many thanks for helping me outβΊοΈβΊοΈ
0
Is my logic correct there?
π€π€π€ I'm very confused
ππ’π’ππ¨ ππ‘ππ²ππ₯
0
ππ’π’ππ¨ ππ‘ππ²ππ₯
Thanks πππ
Hot today
SQL
1 Votes
BMI calculator code project
0 Votes
How to create a border
0 Votes
How do I delete my account?
1 Votes
please help me to solve it..
1 Votes