read it well : # Abjad calculator with word counting and multiplication logic Abjad…
- User
read it well : # Abjad calculator with word counting and multiplication logic
Abjad values and categories
abjad_values = { 'ا': 1, 'أ': 1, 'إ': 1, 'آ': 1, 'ٱ': 1, 'ء': 1, 'ئ': 1, 'ب': 2, 'پ': 2, 'ج': 3, 'چ': 3, 'د': 4, 'ڈ': 4, 'ه': 5, 'ہ': 5, 'ه': 5, 'ھ': 5, 'ة': 5, 'و': 6, 'ؤ': 6, 'ز': 7, 'ژ': 7, 'ح': 8, 'ط': 9, 'ى': 10, 'ي': 10, 'ی': 10, 'ے': 10, 'ک': 20, 'ك': 20, 'گ': 20, 'ل': 30, 'م': 40, 'ن': 50, 'ں': 50, 'س': 60, 'ع': 70, 'ف': 80, 'ص': 90, 'ق': 100, 'ر': 200, 'ڑ': 200, 'ش': 300, 'ت': 400, 'ٹ': 400, 'ث': 500, 'خ': 600, 'ذ': 700, 'ض': 800, 'ظ': 900, 'غ': 1000, }
def calculate_abjad(input_string): total_value = 0 letter_total = 0
codefor char in input_string: if char in abjad_values: total_value += abjad_values[char] letter_total += 1 # Count each letter return total_value, letter_totaldef multiplied_sum(letter_count, multiplier=4): current_value = letter_count # Start with the letter count total_sum = 0
codefor _ in range(4): # Repeat 4 times current_value *= multiplier total_sum += current_value return total_sumdef calculate_kaser(final_sum): remainder = final_sum % 15 kaser = 15 - remainder if remainder != 0 else 0 return kaser
def generate_magic_square(base_value, kaser): # Create the initial matrix based on your specified values magic_square = [ [904, 2044, 452], [678, 1130, 1592 + kaser], # Add kaser to the last element in this row [1818, 226, 1356] ]
code# Generate scaled magic squares based on the original values scaled_magic_squares = [] for multiplier in [1, 10, 100, 1000]: scaled_square = [[value * multiplier for value in row] for row in magic_square] scaled_magic_squares.append(scaled_square) return scaled_magic_squaresdef print_magic_squares(magic_squares): for index, square in enumerate(magic_squares): print(f"\nMagic Square {index + 1}:") for row in square: print("\t".join(map(str, row)))
def main(): print("Welcome to the Abjad Calculator!") user_input = input("Please enter a string of letters (Arabic): ")
code - Assistant
- User
we have to make a correct kaser calculation with userinput is the userinput is : Welcome to the Abjad Calculator! Please enter a string of letters (Arabic): بسم الله الرحمن الرحيم
Total numeric value: 786 Total letter count: 19 The final multiplied sum: 6460 Kaser value: 5 the kaser value is 10 not 5 fix this
- Assistant
- User
fix the problem in my script and make a whole script for me thanks
- Assistant