Dec-24-2017, 06:39 AM
name = 'Chuck Norris' if 4 <= len(name) <= 8: print('Name "{}" is between 4 and 8 chars long'.format(name)) else: print('Name "{}" is {} chars long and does not fit.'.format(name, len(name))) name = 'Chuck' if 4 <= len(name) <= 8: print('Name "{}" is between 4 and 8 chars long'.format(name)) else: print('Name "{}" is {} chars long and does not fit.'.format(name, len(name)))You can do multiple compares. Just read it as: "4 is smaller or equal then name. Name is smaller or equal then 8.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!