Respuesta :

Answer:

Question 1

sum=0

count=0

while(sum<=100):

  x=int(input("Enter a nmber"))

  sum=sum+x

  count=count+1

print("Sum: "+str(sum))

print("Numbers Entered: "+str(count))

Question 2

count = 0

pet = (input("What pet do you have? "))

while(pet != "rock"):

 count = count +1

  print("You have a " + pet +" with a total of " + str(count) + " pet(s)")

  pet = (input("What pet do you have? "))

Explanation:

fichoh

The required program written in python 3 which continues to request user to input a pet name until a rock is entered is as follows :

pet = input('What pet do you have now : ')

#request an input from the user and store in the variable pet

total = 0

#initialize the total number of pets owned to 0

while (pet != 'rock'):

#while loop ensures that program runs until a rock is inputted by the user

total +=1

#adds one to the total after each loop

print('you have a ' + str(pet) + 'with a total of ' + str(total) + ' pet(s)')

#displays the formatted string using the total and pet variables which continues to update

pet = input('What pet do you have now: ')

#requests user to input pet name again as long as rock has not been supplied.

Therefore, an output of the program written is attached below.

Learn more on python programs :https://brainly.com/question/18685986

Ver imagen fichoh
ACCESS MORE
ACCESS MORE
ACCESS MORE
ACCESS MORE