1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
goldenfox [79]
3 years ago
8

Va rog urgent

Computers and Technology
1 answer:
Vladimir [108]3 years ago
7 0

Answer:

875034

Explanation:

You might be interested in
Create a program that will play the “cows and bulls” game with the user. The game works like this: Randomly generate a 4-digit n
riadik2000 [5.3K]

Answer:

Welcome to the Cows and Bulls Game!

 Enter a number:

 >>> 1234

 2 cows, 0 bulls

 >>> 1256

 1 cow, 1 bull

 ...

"""

import random

def compare_numbers(number, user_guess):

   cowbull = [0,0] #cows, then bulls

   for i in range(len(number)):

       if number[i] == user_guess[i]:

           cowbull[1]+=1

       else:

           cowbull[0]+=1

   return cowbull

if __name__=="__main__":

   playing = True #gotta play the game

   number = str(random.randint(0,9999)) #random 4 digit number

   guesses = 0

   print("Let's play a game of Cowbull!") #explanation

   print("I will generate a number, and you have to guess the numbers one digit at a time.")

   print("For every number in the wrong place, you get a cow. For every one in the right place, you get a bull.")

   print("The game ends when you get 4 bulls!")

   print("Type exit at any prompt to exit.")

   while playing:

       user_guess = input("Give me your best guess!")

       if user_guess == "exit":

           break

       cowbullcount = compare_numbers(number,user_guess)

       guesses+=1

       print("You have "+ str(cowbullcount[0]) + " cows, and " + str(cowbullcount[1]) + " bulls.")

       if cowbullcount[1]==4:

           playing = False

           print("You win the game after " + str(guesses) + "! The number was "+str(number))

           break #redundant exit

       else:

           print("Your guess isn't quite right, try again.")

Explanation:

7 0
4 years ago
When a program uses a ____, it reads all the records in the file from beginning to end, processing them one at a time. Group of
DIA [1.3K]

Answer:

nooo noob 2+2=5

Explanation:

why noob bullly bully

4 0
3 years ago
What is the computer?​
DiKsa [7]

Answer:

an electronic machine that can store, find and

8 0
3 years ago
Which of the following is a characteristic of a college savings plan
V125BC [204]

Answer:

where are the options for the question

8 0
3 years ago
Read 2 more answers
Robert brought 10 shares apex company for $18 each and later sold all of them at $17 each. This transaction resulted in what typ
Ghella [55]

Answer:

$1 loss

Explanation:

purchase share=$18

Sold share=$17

Profit/Loss statement=sell- purchase=17-18=-1

If it contain negative value so it is loss

Loss=$1

4 0
3 years ago
Read 2 more answers
Other questions:
  • Chole enjoys her math classes, and she would like to find a career that will allow her to continue use her math skillls which ca
    10·1 answer
  • Select the correct answer from each drop-down menu.
    8·1 answer
  • What are the three business writing formats
    12·1 answer
  • A ______ is a personal computer which stays in one location (e.g. office) due to its larger form factor.
    5·1 answer
  • What does it mean to design,<br> implement, and maintain computer<br> systems?
    15·1 answer
  • Travel agents are market intermediaries who make their living by gathering, organizing, and dispensing information about travel-
    5·1 answer
  • The effects of activating the complement system include all of the following except
    14·1 answer
  • Uh i g08ujunuyv kjmn
    11·2 answers
  • --------------------------------------------------------------------------------------------------------------------------------
    8·1 answer
  • Qué es una magnitud eléctrica
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!