What is the error...Bruh...Can anyone help me
Attachments:
Answers
Answered by
3
Answer:
This is the corrected program for the question.
import math as m
print("Enter the number you want square root for")
a=int(input()) #Note: You can also write float(input())
x=m.sqrt(a)
print(a)
Explanation:
- In the fourth line, you wrote - a = input(). So, a is considered as string. You can't take square root of a string. So, at first, convert the input into either integer or float value and then take the square root.
Similar questions
English,
1 month ago
English,
1 month ago
Computer Science,
1 month ago
Math,
2 months ago
Math,
8 months ago
Math,
8 months ago
Computer Science,
8 months ago