Question: Part 1: Create a function with the signature: avg_string_len(s1, s2, **kwargs), where s1, and s2 are strings and multiple strings can be passed using **kwargs.

 Part 1: Create a function with the signature: avg_string_len(s1, s2, **kwargs),

where s1, and s2 are strings and multiple strings can be passed

using **kwargs. Within the function, you are required to calculate the average

Part 1: Create a function with the signature: avg_string_len(s1, s2, **kwargs), where s1, and s2 are strings and multiple strings can be passed using **kwargs. Within the function, you are required to calculate the average length of all strings. For example, if you have the strings: 'this', 'is', 'an', 'example' as inputs, the expected output would be 3.75 ((4 + 2 + 2 + 7)/4) Part 2: Make the following function calls and store the values in out1, out2, and out3 respectively: avg_string_len('T', 'am', s3='enjoying', s4='Python', s5='Programming', s6='!') avg_string_len('Hello', ' World', s3=""', s4='First', s5='Lesson', s6='') avg_string_len('1', 'am', s3='a ', s4=big : s5='fan', s6='of', s7='Nolan', s8 = 'Movies") Add out1, out2, and out3 into a single list called final_output. (the expected outputs are: [4.83, 3.83, 3.75]) Part 3: Import json and files from google.colab. Open a json file called 'ps6_9.json' and save final_output into it. Open the 'ps6_9.json' in read mode and load the contents into the variable loaded_input. Using if-else conditions print 'Match' if final_output and loaded_input are equal. If not, print 'No match

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!