i have a most basic python code for me abjad calculator i need to add more funstions in…
- User
i have a most basic python code for me abjad calculator i need to add more funstions in it you just have to read and analyze my code for improvement : # Abjad calculator with letter counting # 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 # Total letter count excluding spaces # Normalize input string to handle only valid Arabic letters from our chart for char in input_string: if char in abjad_values: total_value += abjad_values[char] letter_total += 1 # Count each letter return total_value, letter_total def main(): print("Welcome to the Abjad Calculator!") user_input = input("Please enter a string of letters (Arabic): ") total_value, letter_total = calculate_abjad(user_input) print(f"\nTotal numeric value: {total_value}") print(f"Total letter count: {letter_total}") if name == "main": main()
- Assistant
- User
we need to add one more module as or abjad chart to calculate letters values from this chart table as well : ابجد Value Category ا 1 Fire أ 1 Fire إ 1 Fire آ 1 Fire ٱ 1 Fire ء 1 Fire ئ 1 Fire ئ 1 Fire ب 2 Earth پ 2 Earth ج 3 Air چ 3 Air د 4 Water ڈ 4 Water ه 5 Fire ہ 5 Fire ه 5 Fire ھ 5 Fire ة 5 Fire و 6 Earth ؤ 6 Earth ز 7 Air ژ 7 Air ح 8 Water ط 9 Fire ى 10 Earth ي 10 Earth ی 10 Earth ے 10 Earth ک 11 Air ك 11 Air گ 11 Air ل 12 Water م 13 Fire ں 14 Earth ن 14 Earth س 15 Air ع 16 Water ف 17 Fire ص 18 Earth ق 19 Air ر 20 Water ڑ 20 Water ش 21 Fire ت 22 Earth ٹ 22 Earth ث 23 Air خ 24 Water ذ 25 Fire ض 26 Earth ظ 27 Air غ 28 Water
- Assistant