0% found this document useful (0 votes)
22 views1 page

User Age Comparison Script

The document is a Python script that prompts the user to input names and ages for two users. It compares the ages and prints which user is older or if they are the same age. There is a syntax error in the code due to a missing colon in the second conditional statement.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views1 page

User Age Comparison Script

The document is a Python script that prompts the user to input names and ages for two users. It compares the ages and prints which user is older or if they are the same age. There is a syntax error in the code due to a missing colon in the second conditional statement.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

user1Name = input("Enter first users name")

user1Age = input("Enter first users age")


user2Name = input("Enter second users name")
user2Age = input("Enter second users age")
if user1Age > user2Age :
print("user1Name is older")
elif user2Age > user1Age
print("user2Name is older")
else:
print("Both users are the same age")

You might also like