Asked by nick
print("Welcome to the Personal Info & Calulator Program!")
name = input("Enter your name: ")
age = int(input("How old are you "))
number = int(input("Enter your favorite number: "))
college = input("Enter your 1# college choice: ")
career =input("Enter your career of choice :")
new_age = age ** 2
age_ten = age + 10
print (f"\nHello {name}! You are {age} years old.")
print (f" \nIn 10 years you will be {age_ten}")
All Answers 1
Answered by
GPT-5 mini
AI
Nice start — your script runs as-is but doesn't use some of the collected values (favorite number, college, career, new_age) and could use a couple of small fixes (typo in the welcome string, small input validation). Below is an improved version that:
- fixes the welcome message,
- validates integer input for age and favorite number,
- uses and prints all collected values (age squared, favorite-number calculations, college, career),
- formats name/college/career nicely.
Copy and run this in a Python 3 environment:
```
print("Welcome to the Personal Info & Calculator Program!")
name = input("Enter your name: ").strip().title()
def get_int(prompt):
while True:
s = input(prompt).strip()
try:
return int(s)
except ValueError:
print("Please enter a valid integer.")
age = get_int("How old are you? ")
favorite = get_int("Enter your favorite number: ")
college = input("Enter your #1 college choice: ").strip().title()
career = input("Enter your career of choice: ").strip().title()
new_age = age ** 2
age_ten = age + 10
print(f"\nHello {name}! You are {age} years old.")
print(f"In 10 years you will be {age_ten}.")
print(f"Your age squared is {new_age}.")
print(f"Your favorite number is {favorite}.")
print(f"Favorite number times 2: {favorite * 2}")
print(f"Favorite number squared: {favorite ** 2}")
print(f"Top college choice: {college}")
print(f"Career of choice: {career}")
```
If you want, I can:
- add more calculations (BMI, retirement year, etc.),
- store the responses to a file,
- convert this into a GUI or web form,
- localize the prompts or add unit tests. Which would you like?
- fixes the welcome message,
- validates integer input for age and favorite number,
- uses and prints all collected values (age squared, favorite-number calculations, college, career),
- formats name/college/career nicely.
Copy and run this in a Python 3 environment:
```
print("Welcome to the Personal Info & Calculator Program!")
name = input("Enter your name: ").strip().title()
def get_int(prompt):
while True:
s = input(prompt).strip()
try:
return int(s)
except ValueError:
print("Please enter a valid integer.")
age = get_int("How old are you? ")
favorite = get_int("Enter your favorite number: ")
college = input("Enter your #1 college choice: ").strip().title()
career = input("Enter your career of choice: ").strip().title()
new_age = age ** 2
age_ten = age + 10
print(f"\nHello {name}! You are {age} years old.")
print(f"In 10 years you will be {age_ten}.")
print(f"Your age squared is {new_age}.")
print(f"Your favorite number is {favorite}.")
print(f"Favorite number times 2: {favorite * 2}")
print(f"Favorite number squared: {favorite ** 2}")
print(f"Top college choice: {college}")
print(f"Career of choice: {career}")
```
If you want, I can:
- add more calculations (BMI, retirement year, etc.),
- store the responses to a file,
- convert this into a GUI or web form,
- localize the prompts or add unit tests. Which would you like?
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.