"""simple docstring"""






def     UpperCAmelCase__ (       lowerCAmelCase__  :str	)				->					bool:
      '''simple docstring'''


      return credit_card_number.startswith(("""34""", """35""", """37""", """4""", """5""", """6""")	)


def     UpperCAmelCase__ (       lowerCAmelCase__  :str	)				->					bool:
      '''simple docstring'''


      lowercase														=			credit_card_number
      lowercase														=			0
      lowercase														=			len(lowerCAmelCase__	) - 2
      for i in range(lowerCAmelCase__      ,	-1      ,	-2	):
            #  double the value of every second digit
            lowercase														=			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 %= 1_0
                  digit += 1
            lowercase														=			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 % 1_0 == 0


def     UpperCAmelCase__ (       lowerCAmelCase__  :str	)				->					bool:
      '''simple docstring'''


      lowercase														=			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 1_3 <= len(lowerCAmelCase__	) <= 1_6:
            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""")




"""simple docstring"""






def     UpperCAmelCase__ (       lowerCAmelCase__  :str      ,	lowerCAmelCase__  :int	)				->					list:
      '''simple docstring'''


      lowercase														=			word.split()

      def justify(lowerCAmelCase__  :list      ,	lowerCAmelCase__  :int      ,	lowerCAmelCase__  :int	) -> str:
            lowercase														=			max_width - width
            lowercase														=			len(lowerCAmelCase__	)
            if len(lowerCAmelCase__	) == 1:
                  # if there is only word in line
                  # just insert overall_spaces_count for the remainder of line
                  return line[0] + " " * overall_spaces_count
            else:
                  lowercase														=			words_count - 1
                  # num_spaces_between_words_list[i] : tells you to insert
                  # num_spaces_between_words_list[i] spaces
                  # after word on line[i]
                  lowercase														=			spaces_to_insert_between_words * [
                      overall_spaces_count // spaces_to_insert_between_words
                  ]
                  lowercase														=			(
                      overall_spaces_count % spaces_to_insert_between_words
                  )
                  # distribute spaces via round robin to the left words
                  for i in range(lowerCAmelCase__	):
                        num_spaces_between_words_list[i] += 1
                  lowercase														=			[]
                  for i in range(lowerCAmelCase__	):
                        # add the word
                        aligned_words_list.append(line[i]	)
                        # add the spaces to insert
                        aligned_words_list.append(num_spaces_between_words_list[i] * """ """	)
                  # just add the last word to the sentence
                  aligned_words_list.append(line[-1]	)
                  # join the aligned words list to form a justified line
                  return "".join(lowerCAmelCase__	)

      lowercase														=			[]
      lowercase														=			[]
      lowercase														=			0
      for word in words:
            if width + len(lowerCAmelCase__	) + len(lowerCAmelCase__	) <= max_width:
                  # keep adding words until we can fill out max_width
                  # width = sum of length of all words (without overall_spaces_count)
                  # len(word) = length of current word
                  # len(line) = number of overall_spaces_count to insert between words
                  line.append(lowerCAmelCase__	)
                  width += len(lowerCAmelCase__	)
            else:
                  # justify the line and add it to result
                  answer.append(justify(lowerCAmelCase__      ,	lowerCAmelCase__      ,	lowerCAmelCase__	)	)
                  # reset new line and new width
                  lowercase							,							lowercase														=			[word], len(lowerCAmelCase__	)
      lowercase														=			max_width - width - len(lowerCAmelCase__	)
      answer.append(""" """.join(lowerCAmelCase__	) + (remaining_spaces + 1) * """ """	)
      return answer


if __name__ == "__main__":
       from doctest import testmod

       testmod()



