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
  • 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...

  • 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...

  • 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...

  • 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...

  • 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 floor from random import randint 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)), • the sum() function returns the sum of a list of integers (sum(1,2,3,4) returns 10). problem 1 a. Implement a function invPrime(a, p) that takes two integers a and p > 1 where...

  • Use Python Write a script to perform various basic math and string operations. Use some functions...

    Use Python 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 the remainder of 5 divided by 3 Built-in functions abs, round, and...

  • # Please use Python to do this question. # import turtle to do this question. Write...

    # Please use Python to do this question. # import turtle to do this question. Write a function, grade_histogram(t,mu,sigma,n), which uses the turtle module to make a histogram for quiz score data for n = 100 students.   First, create the data using gauss(mu,sigma), from the random module. mu is the average and sigma is the standard deviation of the scores and is a measure of the spread of the data scores. When the quiz data is generated, check to make...

  • python 3 8.12 LAB: Python cross reference In addition to editors and compilers, a software developer...

    python 3 8.12 LAB: Python cross reference In addition to editors and compilers, a software developer may use tools to analyze the software they are writing to examine the names being used for variables and functions, and list the line numbers where the variables and functions names appear. For example, consider the following program savings.py used to compute the month to month interest gained from a certificate of deposit: 1: Input the CD APR, no years and initial deposit 2:...

  • 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 .bit_length() method to efficiently obtain the bit length of an integer, • the abs() function for computing the absolute value of an integer, • and the // operator for integer division (you should avoid using / because it does not work for very large integers). Implement the following Python functions. These functions...

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
ADVERTISEMENT