# --------------------------------------- # CSCI 127, Joy and Beauty of Data | # Lab 4: Recursion and Strings | # Your Name, Your Partner's Name | # Date: September 19, 2023 | # --------------------------------------- # Implement concatenation with both an | # iterative and recursive function. | # Do the same for count. | # --------------------------------------- def main(): """ This tests the four required functions. Do not change this code. """ print("CSCI 127, Lab 4") print("---------------") string_1 = input("Enter a first string: ").lower() string_2 = input("Enter a second string: ").lower() print("\nString Concatenation Testing") print("----------------------------") print("Using built-in +: ", string_1 + string_2) print("Using concatenation_loop function: ", \ concatenation_loop(string_1, string_2)) print("Using concatenation_recursion function: ", \ concatenation_recursion(string_1, string_2)) print("\nOccurences of Second String in First String Testing") print("---------------------------------------------------") print("Using built-in count: ", string_1.count(string_2)) print("Using occurrences_loop function: ", \ occurrences_loop(string_1, string_2)) print("Using occurrences_recursion function: ", \ occurrences_recursion(string_1, string_2)) # --------------------------------------- main()