Question: Hello I keep getting an error with my code may you tell me what's wrong and write it so I can actually execute it. I

Hello I keep getting an error with my code may you tell me what's wrong and write it so I can actually execute it. I get a value error alot and its just not working

(Please use Python)

1)

Hello I keep getting an error with my code may you tell

me what's wrong and write it so I can actually execute it.

2)

I get a value error alot and its just not working (Please

use Python) 1) 2) 3) 4) \# Using double precision to get

3)

the value of 010000000111111010111001 (in five decimals) val = float("0b" + "010000000111111010111001")

print("\{:5f\}".format(val)) Traceback (most recent call last): File "main.py", line 2, in val

4)

= float("0b" + "010000000111111010111001") ValueError: could not convert string to float: '

0 b010000000111111010111001' \# Using 3 digit chop arithmetic to get the result

\# Using double precision to get the value of 010000000111111010111001 (in five decimals) val = float("0b" + "010000000111111010111001") print("\{:5f\}".format(val)) Traceback (most recent call last): File "main.py", line 2, in val = float("0b" + "010000000111111010111001") ValueError: could not convert string to float: ' 0 b010000000111111010111001' \# Using 3 digit chop arithmetic to get the result val = int ("0b+"01000000011111010111001",2) ** Process exited - Return Code: 0 ** Press Enter to exit terminal \# Using 3 digit rounding arithmetic to get the result val = round(float ("0b+"010000000111111010111001"),3) print("\{::3f\}".format ( val )) Traceback (most recent call last): File "main.py", line 2, in val=round(float("0b"+"010000000111111010111001"),3) valueError: could not convert string to float: ' 06010000000111111010111001 ' \# Absolute error abs_error = abs(val - float ("0b"+"010000000111111010111001")) \# Relative error rel_error = abs_error / float(" b"+ "01000000011111010111001") print("Absolute error: {:3f}". format(abs_error)) print("Relative error: {:3f}". format(rel_error) ) Traceback (most recent call last): File "main.py", line 2, in abs_error = abs(val - float("0b" + "o10000000111111010111001")) NameError: name "val' is not defined

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!