Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

need help writing a function in python 3 function needs to be able to re prompt the user for a input if they input something

need help writing a function in python 3

function needs to be able to re prompt the user for a input if they input something like a letter ("a" is an input)

if the input is 2.5 the output should be "-0.8011436133"

 

image text in transcribed

approximate_sin(x)---> float: b. This function accepts as input a numeric value X (measured in radians) and returns the approximate value of the sine of X. The number should be rounded to 10 decimal digits after the decimal point. The number is calculated as: sin(x) = f(-1)" 2012 = (2n+1)! The program will expand the series until the absolute value of the next term in the series is less than 1.0e-7 (the specified epsilon); that term will not be included in the sum. The parameter is a string; if it isn't in the correct format for a float, return None. C. Parameters: x (str) d. Returns: float or None e. The function displays nothing. approximate_cos (x) ---> float: a. This function accepts as input a numeric value X (measured in radians) and returns the approximate value of the cosine of X. The number should be rounded to 10 decimal digits after the decimal point. The number is calculated as: cos(x) = $(-1)" 42" cos(x)=2 (2n)! The program will expand the series until the absolute value of the next term in the series is less than 1.0e-7 (the specified epsilon); that term will not be included in the sum. The parameter is a string; if it isn't in the correct format for a float, return None. b. Parameters: x (str) c. Returns : float or None d. The function displays nothing

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions