You can do:
s = [1, 2, 3, 4]
print 'y' if len(s) > 5 else 'n'
However I don't think this makes the code more readable (at a glance). Also note that if and else don't create a loop, they are simply statements for control flow. Loops are written using for and while.