Q. Find out the error and the reason for the error in the following code. Also, give the corrected code.
a, b = "5.0", "10.0"
x = float (a/b)
print(x)
Answer =
Correct code:-
a, b = 5.0, 10.0
x = float (a/b)
print(x)
Reason:- String value cannot divide. That’s why it give error.
tq for this solution as it is very easy to copy
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )