def zorome_check(check_value: str) -> bool:
if not check_value.isdigit():
return False
check_value_length: int = len(check_value)
if check_value_length<2:
return False
for i in range(1, check_value_length):
if check_value[0]!=check_value[i]:
return False
return True
input_value: str = input('1 以上の整数を入力してください。 >>> ')
if zorome_check(input_value):
print('ゾロ目です')
else:
print('ゾロ目ではありません')
コメント