Where did you get this code from? You have no clue about it. For example:
1. what is
a=input
?
2. what is
random.sample((1,30),a)
?
3. what is
element
?
4. Many more syntax and logical errors...
You really have to start to
Learn Python[
^] properly. BTW, ditch Python 2, go for Python 3.