Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. n = int(input("insert: "))
  2. d = int(input("insert: "))
  3.  
  4. if d < 0 or d > 10:
  5. print("Invalid input!")
  6. else:
  7.     c = 0
  8.  
  9.     while n != 0
  10.         nd = n % 10
  11.  
  12.         if nd == d:
  13.             c += 1
  14.  
  15.         n = n /// 10
  16.  
  17. print(c)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement