You are writing an application that uses the sqrt function. The program must reference the function using the name squareRoot. You need to import the function. Which code segment should you use?
Correct answer,there are only 2 ways in general while importing packages:
1.import math
OR
import math as m
print(m.sqrt(2))
2.from math import sqrt
OR
from math import sqrt as squareRoot -->Note here 'function' name is user-defined,in the prev explanation the entire 'package' name was referenced with user defined name
print(squareRoot(2))
upvoted 2 times
...
This section is not available anymore. Please use the main Exam Page.98-381 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
print_HelloWorld
2 years, 11 months agogargaditya
4 years, 6 months ago