Question

write a function that recieves degrees as an argument and uses a function in the math...

write a function that recieves degrees as an argument and uses a function in the math module to convert degree to radians. it should returns to the calling program.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

import math

def to_radians(d):

  return math.radians(d)

#reading input as degrees

d=float(input("Enter degrees: "))

#converting given degrees into radians

r=to_radians(d)

print(d," degrees = ",r," radians")

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
write a function that recieves degrees as an argument and uses a function in the math...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • c++ Write a function that uses recursion to raise a number to a power. The function...

    c++ Write a function that uses recursion to raise a number to a power. The function should accept two arguments: the number to be raised and the exponent. Assume that the exponent is a nonnegative integer. Demonstrate the function in a program. Write a function that accepts an integer argument and returns the sum of all the integers from 1 up to the number passed as an argument. For example, if 50 is passed as an argument, the function will...

  • Write a function that takes temperature in degrees Fahrenheit as input and returns the temperature in...

    Write a function that takes temperature in degrees Fahrenheit as input and returns the temperature in degree Celsius as output. Here is the signature of the function: double toCelsius (double) Following is the formula to convert °F to °C:

  • Write a program with a function that accepts a string as an argument and returns a...

    Write a program with a function that accepts a string as an argument and returns a copy of the string with the first character of each sentence capitalized. For instance, if the argument is “hello. my name is Joe. what is your name?” the function should return the string “Hello. My name is Joe. What is your name?” The program should let the user enter a string and then pass it to the function. The modified string should be displayed.

  • Write the definition of a function oneMore which recieves a parameter containing an integer value and...

    Write the definition of a function oneMore which recieves a parameter containing an integer value and returns an integer that is one more than the value of the parameter. PTHON ONLY

  • a. Ask the user for the input of a letter (char type). Write a function that...

    a. Ask the user for the input of a letter (char type). Write a function that takes a char as the argument (parameter) and returns the ASCII value of that char back to the caller. Call the function using the char variable and taking input from the user (no validation required). Display the value in ASCII. b. Write a program that takes a char as the argument (parameter) and uses a loop to interrogate the char, calling a function that...

  • In-Lab Assignment 5 (Quiz 5) Write a CH function called area that takes the edge as...

    In-Lab Assignment 5 (Quiz 5) Write a CH function called area that takes the edge as an argument and returns the surface area of a cube, which should be calculated as shown: Area = 6 * edge?; Then write a main program that asks the user to enter edge of the cube then prints its area after calling the function.

  • In Python 3 Write code to define a function that uses three arguments, and returns a...

    In Python 3 Write code to define a function that uses three arguments, and returns a result. The function returns True if the first argument is more than or equal to the second argument and less than or equal to the third argument, otherwise it returns False.

  • Exercise 2: Import a Python Math Module You can find a list of all of the...

    Exercise 2: Import a Python Math Module You can find a list of all of the math functions available in the Python.org Math Functions page found in the Resources. Select any math function(s) that you would like to use in a program. Do the following: Write a program that imports the math module and uses the function that you selected. (Hint: You will need to determine the arguments that must be passed to the function, return the result, and display...

  • 2) Write a C++ program that uses a class called “Degree” to obtain the trigonometric values...

    2) Write a C++ program that uses a class called “Degree” to obtain the trigonometric values for angles given in degrees. This is because the trigonometric functions defined in the library file <cmath> are applied to radian angles only. Use the constant DEG2RAD = 0.017453 for conversion from degrees to radians. This class must include a constructor, destructor, and the following functions: a. void set_value(double) b. double get_value() c. double get_sine() d. double get_cosine() e. double get_tangent() f. void read_value()...

  • Write a program to compute the area of a triangle using side-angle-side method and reports the...

    Write a program to compute the area of a triangle using side-angle-side method and reports the area of that triangle (rounded to 2 decimal places). Side-angle-side formula: ???? = 1/ 2 ?? sin(?), where a and b are two sides of the triangle, and C is the included angle. Your program must meet the following criteria to receive full marks: • Randomly generate two values between 5 and 10 (inclusive) for two sides a and b of the triangle, respectively....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT