<jupyter_start><jupyter_text>- [Cows_and_Bulls]Say the number generated by the computer is 1038. An example interaction could look like this:  Welcome to the Cows and Bulls Game!     >Enter a number:  >> 1234  >>> 2 cows, 0 bulls  >> 1253  >>> 1 cow, 1 bull    ...Until the user guesses the number or write "STOP"<jupyter_code>num = "1234"

cow = 0


while cow < 4:
    numero=input("numero")
    cow = 0
    bull = 0
    contador=0
    for i,value in enumerate(numero):
        if value in num and value == num[i] :
            cow+=1  
        elif value in num[contador]:
            bull+=1
            contador+=1
        if numero == "STOP":
            print("STOP")
            break

    print(f" you got {cow} cows and {bull} bulls")




num = "1234"

cow = 0


while cow < 4:
    numero=input("numero")
    cow = 0
    bull = 0
   
    for i,value in enumerate(numero):
        if value in num and value == num[i] :
            cow+=1  
        elif value in num:
            bull+=1
            
        if numero == "STOP":
            print("STOP")
            break

    print(f" you got {cow} cows and {bull} bulls")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11015490533562823, 'fraction_numerical': 0.03270223752151463, 'mean_word_length': 1.9002493765586035, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '306017', 'license': 'MIT', 'n_tokens_mistral': 415, 'n_tokens_neox': 381, 'n_words': 131, 'path': 'week4_EDA_np_pd_json_apis_regex/day2_numpy_pandas_II/theory/python/cows_&_bulls.ipynb', 'repo_name': 'PabloEduardoMartinezPicazo/Bootcamp-DataScience-2021', 'size': '1162'}