age1 = int(input("Enter the age of the first person: "))
age2 = int(input("Enter the age of the second person: "))
if age1 < age2:
print("The first person is younger.")
elif age2 < age1:
print("The second person is younger.")
else:
print("Both people are the same age.")
Created
March 16, 2025 22:19
-
-
Save miquelvir/5b9a985eb68440d5d7072729f39bb370 to your computer and use it in GitHub Desktop.
devQuest - 16/03/2025 23:19
char = input('Enter a character: ')
if char >= 'a' and char <= 'z':
print('The letter', char, 'is lowercase')
elif char >= 'A' and char <= 'Z':
print('The letter', char, 'is uppercase')
elif char >= '0' and char <= '9':
print(char, 'is a number')
else:
print(char, 'is a symbol')
# More Pythonic alternative
if 'a' <= char <= 'z':
print('The letter', char, 'is lowercase')
elif 'A' <= char <= 'Z':
print('The letter', char, 'is uppercase')
elif '0' <= char <= '9':
print(char, 'is a number')
else:
print(char, 'is a symbol')
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment