Question: Write a Python program that collects and processes information about pets. Follow these steps: Prompt the user to input the following information: petName ( string
Write a Python program that collects and processes information about pets. Follow these steps:
Prompt the user to input the following information:
petName string
petType string
petAgeInYears float
petWeightInPounds float
Convert the pet's weight from pounds to kilograms. Use the conversion: pound kilograms
Calculate the pet's age in months.
Display the following message about the pet three times, using different formatting methods each time:
"Your PETTYPE named PETNAME is AGEINMONTHS months old and weighs WEIGHTINKG kilograms."
Use fstring formatting for the first display
Use the format method for the second display
Use the operator for string formatting for the third display
Add comments to explain each line or block of your code.
Use camelCase style for variable names.
Implement basic error handling:
If the user enters a nonnumeric value for age or weight, prompt them to enter the information again.
Use a while loop to keep asking until valid input is received.
Round the weight in kilograms and age in months to two decimal places in the output.
After displaying the information, ask the user if they want to input information for another pet. If yes, repeat the process. If no end the program with a "Thank you" message.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
