How can a turn this code into a shorthand line of code? is it possible at all?
I would like the same purpose of the code, but with the least amount of lines possible
inpt = input('Age: ')
age = int(inpt)
if age <= 10:
print('Kid')
elif age > 10 <= 20:
print('Teen')
elif age > 20:
print('Adult')
age >10 <=20doesn't do what you think. It expands to the equivalent ofage > 10 and 10 <= 20. Which means yourAdultcase is never reached, you only printKidorTeen. You want10 < age <= 20.