# PredictingChatbot.py # # Description: This Predicting Chatbot asks the user for their name and age # and predicts how old the user will be in x years. # # Author: AL # Date: Feb. 2024 # Welcome and introduce the user to this Predicting Chatbot print("Welcome to the Predicting Chatbot!") print("This Bot predicts how old you will be in x years.") # Ask the user for their name and age print("Please, enter ... ") name = input("\tyour name (letters): ") age = input("\tyour age (an integer): ") # Validate the name and the age if name.isalpha(): if age.isdigit(): # Convert age from str to int age = int(age) # Ask the user for the number of years in the future for the prediction numYears = input("\tthe number of years (x) for the prediction: ") if numYears.isdigit(): # Convert numYears from str to int numYears = int(numYears) # Predict how old the user will be in 13 years. print(f'\nDear {name}:') print(f'In {numYears} years, you will be {age+numYears} years old.') else: print(f'You entered an invalid number of years: {numYears}.') else: print(f'You entered an invalid age: {age}.') else: print(f'You entered an invalid name: {name}.') print("Bye!")