# How to squeeze the maximum code?

Solve problems in the game Empire of code. In one of the tasks is the following condition: check the password for validity, that is at least 10 characters at least one lowercase, one uppercase and a number. The catch is that the solution need to meet the 100 characters. The shortest code that I got:
``````def golf(n):
x=0
if len(n)>9and(n.isdigit()or n.isalpha())==0and(n.isupper()or n.islower())==0:x=1
return x``````

Don't know what else to cut. Thanks in advance!
August 23rd 19 at 10:31
August 23rd 19 at 10:33
Solution
Code could be written:
``````def golf(n):
return int(len(n)>9and(n.isdigit()or n.isalpha())==0and(n.isupper()or n.islower())==0)``````

Or perhaps this:
``````def golf(n):
return len(n)>9and(n.isdigit()or n.isalpha())==0and(n.isupper()or n.islower())==0``````

But I somehow think that your code does not check the password.
The sea of thanks) came up with the flag, but did not think to clean it up.) - dewayne.O commented on August 23rd 19 at 10:36
August 23rd 19 at 10:35
``````def golf(n):
return n[9:] and not (n.isdigit() and n.isalpha() and n.isupper() and n.islower())``````

there are 83 symbol
I wonder if it tells how to write naibolee cocody code https://iqbotan.blogspot.ru/ - dewayne.O commented on August 23rd 19 at 10:38
Nice :) Only instead of everyone and in brackets or need, but it's still -3 symbol - Laney.Krajcik commented on August 23rd 19 at 10:41

Find more questions by tags Python