
"""simple docstring"""



def 					_UpperCAmelCase      ( __lowerCamelCase   :       Optional[int]		)     ->					Union[str, Any]:
  return credit_card_number.startswith(('''34''', '''35''', '''37''', '''4''', '''5''', '''6''')		)
def 					_UpperCAmelCase      ( __lowerCamelCase   :       Union[str, Any]		)     ->					str:
  _snake_case					     =       credit_card_number
  _snake_case					     =       0
  _snake_case					     =       len(__lowerCamelCase		) - 2
  for i in range(__lowerCamelCase ,					-1 ,					-2		):
    #  double the value of every second digit
    _snake_case					     =       int(cc_number[i]		)
    digit *= 2
    # If doubling of a number results in a two digit number
    # i.e greater than 9(e.g., 6 × 2 = 12),
    # then add the digits of the product (e.g., 12: 1 + 2 = 3, 15: 1 + 5 = 6),
    # to get a single digit number.
    if digit > 9:
      digit %= 10
      digit += 1
    _snake_case					     =       cc_number[:i] + str(__lowerCamelCase		) + cc_number[i + 1 :]
    total += digit

  # Sum up the remaining digits
  for i in range(len(__lowerCamelCase		) - 1 ,					-1 ,					-2		):
    total += int(cc_number[i]		)

  return total % 10 == 0
def 					_UpperCAmelCase      ( __lowerCamelCase   :       List[str]		)     ->					Dict:
  _snake_case					     =       f'''{credit_card_number} is an invalid credit card number because'''
  if not credit_card_number.isdigit():
    print(f'''{error_message} it has nonnumerical characters.'''		)
    return False

  if not 13 <= len(__lowerCamelCase		) <= 16:
    print(f'''{error_message} of its length.'''		)
    return False

  if not validate_initial_digits(__lowerCamelCase		):
    print(f'''{error_message} of its first two digits.'''		)
    return False

  if not luhn_validation(__lowerCamelCase		):
    print(f'''{error_message} it fails the Luhn check.'''		)
    return False

  print(f'''{credit_card_number} is a valid credit card number.'''		)
  return True


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 validate_credit_card_number('4111111111111111')
 validate_credit_card_number('32323')







import socket
def 			_a (      ):


		"""simple docstring"""




		lowercase__            =      socket.socket(socket.AF_INET						,				socket.SOCK_STREAM     )
		lowercase__            =      socket.gethostname()
		lowercase__            =      1_23_12

		sock.connect((host, port)     )
		sock.send(B'''Hello server!'''     )

		with open('''Received_file'''						,				'''wb'''     ) as out_file:
				print('''File opened'''     )
				print('''Receiving data...'''     )
				while True:
						lowercase__            =      sock.recv(10_24     )
						if not data:
								break
						out_file.write(SCREAMING_SNAKE_CASE     )

		print('''Successfully received the file'''     )
		sock.close()
		print('''Connection closed'''     )


if __name__ == "__main__":
			main()


