Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

challenge activity 2.9.3: Writing math calculations. 571604.4194510.qx3zqy7 Jump to level 1 Compute: answer=p/q2 Click here for example Ex: If the input is: 4.00 2.00 then

challenge activity

2.9.3: Writing math calculations.

571604.4194510.qx3zqy7

Jump to level 1

Compute: answer=p/q2

Click here for exampleEx: If the input is:

4.00 2.00 

then the output is:

1.00

1

2

3

4

5

6

7

8

import math

p = float(input())

q = float(input())

print(f'{answer:.2f}') # Outputs answer with 2 decimal places

1

2

3

4

CheckNext level

math.pow() is used to compute q to the power of 2. Then, math.sqrt() is used to compute the square root of p / math.pow(q, 2).

Not all tests passed.

clear1: Compare outputkeyboard_arrow_up

Traceback (most recent call last): File "/home/runner/local/submission/student/main.py", line 6, in result = a / b NameError: name 'a' is not defined

Input

4.00 2.00

Your output

Your program produced no output

Expected output

1.00

clear2: Compare outputkeyboard_arrow_up

Traceback (most recent call last): File "/home/runner/local/submission/student/main.py", line 6, in result = a / b NameError: name 'a' is not defined

Input

3.00 8.00

Your output

Your program produced no output

Expected output

0.22

clear3: Compare outputkeyboard_arrow_up

Traceback (most recent call last): File "/home/runner/local/submission/student/main.py", line 6, in result = a / b NameError: name 'a' is not defined

Input

12.00 -3.00

Your output

Your program produced no output

Expected output

1.15

1

2

3

4

Feedback?

How was this section?

thumb_up

|

thumb_down

Provide section feedback

Activity summary for assignment:

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

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

Recommended Textbook for

Introduction to Probability

Authors: Mark Daniel Ward, Ellen Gundlach

1st edition

716771098, 978-1319060893, 1319060897, 978-0716771098

More Books

Students also viewed these Mathematics questions

Question

describe communications theory

Answered: 1 week ago