Question

Reference: Case Study 1 (Python) >>> import math >>> numsides = 8 >>> innerangleB = 360.0/numsides...

Reference: Case Study 1 (Python)

>>> import math

>>> numsides = 8

>>> innerangleB = 360.0/numsides

>>> halfangleA = innerangleB/2

>>> onehalfsideS = math.sin(math.radians(halfangleA))

>>> sideS = onehalfsideS * 2

>>> polygonCircumference = numsides * sideS

>>> pi = polygonCircumference / 2

>>> pi

3.0614674589207183

>>>

Refer to the session in the accompanying case study. Which line uses the math module?

A.

innerangleB = 360.0/numsides

B.

onehalfsideS = math.sin(math.radians(halfangleA))

C.

pi = polygonCircumference / 2

D.

sideS = onehalfsideS * 2

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Option B: onehalfsideS = math.sin(math.radians(halfangleA))

import math # It import math module from the library

math.sin() math.radians() # Accessing math module functions

math.radians(halfangleA) # It converts angle halfangleA from degrees to radians

math.sin(math.radians(halfangleA)) # It returns sine of math.radians(halfangleA), in radians

################### Please ask me if any queries. Thank You. ########################

Add a comment
Know the answer?
Add Answer to:
Reference: Case Study 1 (Python) >>> import math >>> numsides = 8 >>> innerangleB = 360.0/numsides...
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
  • 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...

  • This problem demonstrates the use of import module. The Python programming language has many strengths, but...

    This problem demonstrates the use of import module. The Python programming language has many strengths, but one of its best is the availability to use many existing modules for various tasks, and you do not need to be an experienced computer programmer to start using these modules. We have given you some incomplete code; note that the very first line of that code contains an import statement as follows: import math This statement enables your program to use a math...

  • You may import the following library functions in your module: from fractions import gcd from math...

    You may import the following library functions in your module: from fractions import gcd from math import log from math import floor 'You may also use: • the built-in pow() function to compute modular exponents efficiently (i.e., ak mod n can be written in Python as pow(a,k,n)), You may also need to import your hw3 (will be attached below) 5. Implement a function makePrime(d) that takes a single integer argument d where d >= 1 and returns a probably prime...

  • 1. In Python, 'mutable' objects such as lists are passed to functions 'by reference'. This means:...

    1. In Python, 'mutable' objects such as lists are passed to functions 'by reference'. This means: a.) Changes made to the object within the function persist after the function completes b.) The function receives a copy of the object c.) Python keeps a history of where then object was used d.) Statements in the function can refer to the object by nickname 2. Which of the following is NOT a requirement for a Python function: a.) The function must have...

  • I need help with my python class. thanks! Question 12 Code Example 4-4 main program: import...

    I need help with my python class. thanks! Question 12 Code Example 4-4 main program: import arithmetic as a def multiply(num1, num2):     product = num1 * num2     result = a.add(product, product)     return result     def main():     num1 = 4     num2 = 3     answer = multiply(num1, num2)     print("The answer is", answer) if __name__ == "__main__":     main() arithmetic module: def add(x, y):     z = x + y     return z Refer to Code...

  • hello, please help me to answers my python subjects, I'm new students. I highly appreciate your...

    hello, please help me to answers my python subjects, I'm new students. I highly appreciate your effort. thanks in advanced.. Kindly answers all of this please, I'm begging... 1.) Knowing that a function named fun() resides in a module named mod, choose the proper way to import it:    a.) from mod import fun    b.) from fun import mod    c.) import fun    d.) import fun from mod 2.) Knowing that a function named fun() resides in a...

  • using python with only using import math and copy no other powerful functions. Write a function...

    using python with only using import math and copy no other powerful functions. Write a function defined as: def GaussSeidel(Aaug, x, Niter = 15): Purpose: use the Gauss-Seidel method to estimate the solution to a set of N linear equations expressed in matrix form as Ax = b. Both A and b are contained in the function argument – Aaug. Aaug: an augmented matrix containing [A | b ] having N rows and N+1 columns, where N is the number...

  • Solve the code below: CODE: """ Code for handling sessions in our web application """ from bottle import request, response import uuid import json import model import dbsche...

    Solve the code below: CODE: """ Code for handling sessions in our web application """ from bottle import request, response import uuid import json import model import dbschema COOKIE_NAME = 'session' def get_or_create_session(db): """Get the current sessionid either from a cookie in the current request or by creating a new session if none are present. If a new session is created, a cookie is set in the response. Returns the session key (string) """ def add_to_cart(db, itemid, quantity): """Add an...

  • This is for Python class questions. 1 Python question: While you can add or subtract an...

    This is for Python class questions. 1 Python question: While you can add or subtract an int value to or from a Decimal object, you cannot __________ Decimal objects with __________. A multiply, ints B mix, float values C divide, anything D mix, the quantize method 2 Python question: One way to deal with unexpected results that may come from floating-point numbers is to use rounding, but you can also use decimal numbers by importing the __________ from the __________....

  • Use Python WingPersonal to compile and also please give output Math and String operations Write a...

    Use Python WingPersonal to compile and also please give output Math and String operations Write a script to perform various basic math and string operations. Use some functions from Python's math module. Generate formatted output. Basic math and string operations Calculate and print the final value of each variable. a equals 3 to the power of 2.5 b equals 2 b equals b + 3 (use +=) c equals 12 c = c divided by 4 (use /=) d equals...

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