How to use the function


#1



https://www.codecademy.com/en/courses/python-beginner-c7VZg/2/3?curriculum_id=4f89dab3d788890003000096


in console it says as below
File "python", line 3
from module import.sqrt
^
SyntaxError: invalid syntax

and error says
Oops, try again. Your code looks a bit off. Check the Hint if you need help! Your code threw the following error: invalid syntax (python, line 3)


# Import *just* the sqrt function from math on line 3!

from module import.sqrt


#2

If you remember, there are many different modules that contain functions. Currently you are trying to import a function from module, module doesn't exist, it's just a name for the various modules that do exist. If you look closely at the instructions it will tell you which module you want.

Also there should be a space, not a period, between import and sqrt.


#3

Can you say the types of module and the functions.

I can;t understand.. im not getting output even i use the code below`
from module import sqrt

`


#4

There are hundreds of different modules available. The documentation for python has a list, you can find it here https://docs.python.org/2/py-modindex.html

In this case you need to import the sqrt function from the math module.


#5

Thanks a lot.. i didnt first understand syntax .. got output bro =D


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.