Loops are program statements that are repeated as long as the loop condition is true.
The loop in Python, where comments are used to explain each line is as follows:
#This initializes the number of pets to 0
count = 0
#This gets input for the pet name
pet = input("Pet: ")
#This is repeated until the user enters "rock"
while pet.lower() != "rock":
#This increases the number of pets by 1
count+=1
#This prints the pet and the number of pets
print("You have a",pet,"with a total of",str(count),"pet(s)")
#This gets input for the pet name
pet = input("Pet: ")
Read more about loops at:
brainly.com/question/19344465