stop = False
text_count = 0
while stop is False:
int_string = input("What is the initial string? ")
int_string = int_string.lower()
for a in int_string:
for a in b:
text_count += 1
if text_count < 3:
print("Error: string must have at least 3 characters.")
elif len(int_string) != 'X' or len(int_string) != 'x' or len(int_string) != '_':
print("Error: string must contain only X and _.")
此字符串必须至少有 3 个字符长,并且必须仅包含字符“X”、“x”或“_”(下划线)也不区分大小写