Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user =input("enter a 4 digit number :")
- import random
- comp = str(random.randint(1000,9999))
- i = 0
- bull = 0
- cow = 0
- while i<4:
- if user[i] == comp[i]:
- bull = bull + 1
- i += 1
- e = 0
- while e<4:
- if user[e] in comp:
- cow = cow + 1
- e = e + 1
- print(comp)
- print(bull)
- print(cow)
Advertisement
Add Comment
Please, Sign In to add comment