Method and variable syntax


#1



Replace this line with your code.

is .now a method ? and how could a method name be used as variable name ?


#2

edit your post plz, .now is an method that need to call that module in first step, then use class or object.

never forget you can't import a method of class, just you can import class of modules.

exp:

from datetime import datetime

datetime.now()

the first datetime is a module, but second datetime is a class of that mudule. and now() is method of that class :smiley:

or in act is

import datetime

datetime.datetime.now()