Home / Expert Answers / Computer Science / secondary-school-python-programming-need-solution-thanks-in-advance-orogram-was-written-to-d-pa632

(Solved): Secondary school Python programming. Need solution. thanks in advance orogram was written to d ...



student submitted image, transcription available below

Secondary school Python programming. Need solution. thanks in advance

orogram was written to determine if two strings are balanced. Io strings are considered balanced if all the characters in the second string can be found inside first string, regardless of the order and number of appearances. while True: print(\"Welcome to the string balancer\") st1 = input('string \\( 1: \\) ') st2 = input ('string \\( 2: \\) ') check = True for char in st2: \\( \\quad \\) if char not in st1: \\( \\quad \\) check = False if check == True: print(\"Strings are balanced\") print(\"Strings are not balanced\") if input (\"again? (y/n): \")! 'y': while True: print(\"Welcome to the string balancer\") st1 = input ('string \\( 1: \\) ') st2 = input('string \\( 2: \\) ') check \\( = \\) True for char in st2: if char not in st1: check = False if check == True: print(\"Strings are balanced\") else: print(\"Strings are not balanced\") if input(\"again? (y/n): \")!= 'y' : break Open the file T2_BALANCER.py Modify the program such that 7 it outputs the length of st1 and st2 after each of them has been keyed in. 8 it compares the length of both strings and outputs which string is longer. 9 accepts both \" \\( y \\) \" and \" \\( Y \\) \" when it prompts the user if they would like to compare another set of strings. Save your work as T2_Balancer_01_INDEXNO_NAME.py. Save a copy of your file as T2_Balancer_02_INDEXNO_NAME.py 10 Modify your program such that it stores st1 and st2 in a list instead of two separate variables. Modify the rest of the program such that it uses the new list at appropriate junctures.


We have an Answer from Expert

View Expert Answer

Expert Answer






We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe