Question: PYTHON CODE 5. Insert a line comment to identify each step, i.e.: # Step 6. 6. Age Program: (create if...else statement) Get user input for
PYTHON CODE
5. Insert a line comment to identify each step, i.e.: # Step 6.
6. Age Program: (create if...else statement)
Get user input for a variable named yourAge as a digit and cast to int()
If Age is greater than or equal to 12 then display a message stating their age in 10 years
If Age is less than 12, display a message It is good to be age Output example: In only 10 years you will be 26. or It is good to be 16.
7. Number Program: (create if...else statement and use casting)
Get user input for a number Check if the input is a number, and if not, cast to int()
Compare number entered by user to 100
Display the result Example output (if user entered 37): 37 greater than 100 is False
8. Letter Guess Program: (create a function that gives the user 3 guesses)
Create letterGuess() function
Call passes a letter character argument as the answerLetter (choose your favorite letter for this)
Get user input() for userGuess and if not alpha character, print Invalid and return False
Call letterGuess with the answerLetter and the userGuess
End letterGuess if o letterGuess equals True, return True o After 3 failed attempts, return False
9. Pet Conversation program (function not needed for this program)
Get User input for string variable: petInfo
Use a series of if statements and respond with appropriate conversation o Check if dog is in the string o Check if pig is in the string o Check if one more animal is in the string (use your favorite animal)
Do not need to code elses
Finish by thanking User for the pet info
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
