What is the output of this code? import math as m print(math.sqrt(25)) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the output of this code? import math as m print(math.sqrt(25))

output of above code will be 5.0. If you go on solving the questions in modules section, You will come across this. where from the options if you select 5 it gives wrong submission. But if you solve this one, you will get the answer 5.0 which should have been there in options correctly i guess.

11th Apr 2020, 4:43 AM
sharayu barwe
sharayu barwe - avatar
2 Answers
+ 2
If we had provide an alias name to module while importing then it is mandatory to use alias name otherwise it raises error
11th Apr 2020, 10:06 AM
ANJALI SAHU
+ 1
This actually raises an error because you are trying to import math module as "m".So, in the print statement there is no need of specifying math. If you specify you will overcome an error instead you can go with the usage of "m" like "print(m.sqrt(25))"
11th Apr 2020, 4:57 AM
Kiran Deep Naidu
Kiran Deep Naidu - avatar