CARVIEW |
Select Language
HTTP/2 200
date: Tue, 14 Oct 2025 11:37:27 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=b12144b176fe02044c5a5ea458a9f6f8c05afe4d56bd99427136061fc8105b62a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22h1kO4hZd_-7qbAAJUIdOOTrjXuuqhOuO%22%3B%7D; HttpOnly; Path=/
cf-ray: 98e6c8e958cf343c-BLR
Bulls and Cows Python - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- attempts = 0
- while True:
- num = str(random.randrange(1000,10000))
- count = [num.count(i) for i in num if num.count(i)>1]
- if not count: break
- while True:
- guess = input()
- bulls, cows = 0,0
- attempts += 1
- if [guess.count(j) for j in guess if guess.count(j)>1]:
- print("Duplicate number entered, please try again")
- continue
- for idx,dgt in enumerate(guess):
- if dgt == num[idx]:
- bulls+=1
- continue
- elif dgt in num:
- cows+=1
- continue
- if bulls==4: print(f"Number : {num}\nAttempts : {attempts}")
- else: print(f"{bulls}A {cows}B")
Advertisement
Add Comment
Please, Sign In to add comment
-
💵 Make 3000$ in 20 minutes 💵
JavaScript | 9 sec ago | 0.24 KB
-
🔥 Exchange profit method
JavaScript | 18 sec ago | 0.24 KB
-
🚀 Swapzone +37% glitch
JavaScript | 1 min ago | 0.24 KB
-
💎 ChangeNOW Exploit
JavaScript | 1 min ago | 0.24 KB
-
💡 EASY MONEY GUIDE ✅ Working
JavaScript | 1 min ago | 0.24 KB
-
⚡ Crypto Swap Glitch ✅ Working ⚡
JavaScript | 1 min ago | 0.24 KB
-
💵 Make 3000$ in 20 minutes 💵
JavaScript | 1 min ago | 0.24 KB
-
⭐⭐⭐Crypto Accounts⭐⭐
Java | 1 min ago | 0.15 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand