while True:
InputWord = input("Please input the variable's name:")
Length = len(InputWord)
if Length == 0:
continue
else:
if InputWord[0].isalpha() == 1 or InputWord[0] == '_':
for N in range(1,Length):
if InputWord[N].isalnum() != 1 and InputWord[N] != '_':
print("Your input is illegal.")
break
else:
print("Your input is legal.")
else:
print("Your input is illegal.")