Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Write the Python Code for the given question For each of the following problems, you should submit a separate python file. For simplicity, in

image text in transcribed

Please Write the Python Code for the given question

For each of the following problems, you should submit a separate python file. For simplicity, in the questions below you can assume that the user will not provide invalid inputs. For examples, if prompted for an integer, the user will provide an integer and not an alphabetical string for example. 1. (5 points) write a function to caclculate the sine function using the infinite series below. The function should take two arguments the x and n, where n is the number of terms to include in the calculation of sin(x). n should have a default value of 10. 15 sin(x) = 1 + 3! 5! Test your function with the following program. r9 9! 7! print(my_sin(0)) print (my_sin(1,3)) print (my_sin(math.pi/2)) print (my_sin(math.pi/4)) print(my_sin(math.pi/6)) You should get the following output 0.0 0.8416666666666667 1.0 0.7071067811865475 0.49999999999999994 Process finished with exit code 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Murach's SQL Server 2012 For Developers

Authors: Bryan Syverson, Joel Murach, Mike Murach

1st Edition

1890774693, 9781890774691

More Books

Students also viewed these Databases questions

Question

How does nonverbal communication express cultural values?

Answered: 1 week ago

Question

Lo6 Identify several management development methods.

Answered: 1 week ago