Question
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
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
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started