Question: 1. Trace and write the ouptut of each Python script: def func(x, y=2): num = 1 for i in range(y): num = num*x return

1. Trace and write the ouptut of each Python script: def func(x, 

1. Trace and write the ouptut of each Python script: def func(x, y=2): num = 1 for i in range(y): num = num*x return num print (func(4)) min (lambda x, y: x if x < y else y) print(min(101.99, 102*98)) myList [lambda x: x** 2, lambda x: x** 3, lambda x: x** 4] for fin myList: print(f(3)) def func(): x=1 print(func()) Question 2 2. Write a Python script that evaluates polynomails. The function takes two parameters, number x with default value as 1 and the list of coefficients ordered from highest to lowest. Input: x-4, cofficients [1,2,3] -> Output: 41+42+43 - 84 %23%23 Question 3 #2 #2 3. Write a Python script that creates a dictionary to find the location(s) of each word in an input sentence with spaces between words. Then print the location of an input word. sentence: hi you how are you? d (hi:0, you: 1,4, how:2, are: 3,2:5} word huda -> not found word you at locations 1 and 4

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 Programming Questions!