

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Homework 3
a) list1 = ["M", "na", "i", "Ke"]; list2 = ["y", "me", "s", "lly"] Expected output: ['My', 'name', 'is', 'Kelly'] b) list1 = ["Hello ", "take "]; list2 = ["Dear", "Sir"] Expected output: ['Hello Dear', 'Hello Sir', 'take Dear', 'take Sir']
should display the item in original order and list2 in reverse order. list1 = [10, 20, 30, 40]; list2 = [100, 200, 300, 400] Expected output: 10 400 20 300 30 200 40 100
list1 = [10, 20, [300, 400, [5000, 6000], 500], 30, 40] Expected output: [10, 20, [300, 400, [5000, 6000, 7000], 500], 30, 40]
that it will look like the following Given List:
list1 = ["a", "b", ["c", ["d", "e", ["f", "g"], "k"], "l"], "m", "n"] Sub List to be added = ["h", "i", "j"] Expected output: ['a', 'b', ['c', ['d', 'e', ['f', 'g', 'h', 'i', 'j' ], 'k'], 'l'], 'm', 'n']
list1 = [5, 20, 15, 20, 25, 50, 20] Expected output: [5, 15, 25, 50]
The value of ๐ can be approximated by the following infinite series: ๐ โ 3 +
Write a program that displays 15 approximations of ๐. The first approximation should make use of only the first term from the infinite series. Each additional approximation displayed by your program should include one more term in the series, making it a better approximation of ๐ than any of the appr viously
2 1
a) By The Trapezoidal Rule (see https://en.wikipedia.org/wiki/Trapezoidal_rule). b) By Simpson's rule (see https://en.wikipedia.org/wiki/Simpson%27s_rule).