I need a bit of help on something stupid that i probably should understand


#1



https://www.codecademy.com/courses/python-beginner-en-zFPOx/0/2?curriculum_id=4f89dab3d788890003000096#


I dont know what im doing wrong @greentreemee

from datetime import datetime
now = 4
print datetime.now()

`


#2

Python have something called modules.

What is a module?
Module is collection of tricks. (group of functions,variables and other things)

How to use a module and its function ?
Import them

How to import them?
using this syntax ( If we want to use just one function of module then)

from module import something

You did this in first line of code.

from datetime import datetime

Its all good. Now how to use it?

Actually this module have lots of information about time,date etc.
You can just command computer to show you what current date or time is!

To access all these information we call now at datetime with a dot.
datetime.now()

This one have all information about todays date and time (That what now means).

We can save this information in a variable.
like this..

x = datetime.now()

and print it..

print x #it will print something like this 2017-05-10 12:00:29.245140
(you can see it has date,current time)

but in the exercise you have save that thing in now variable
and print the now !


#3

Thank you once again :slight_smile:


#4

i have a question what lesson are you on just wondering or do you already know python fully


#5

@greentreemee im really confused on what to do here https://www.codecademy.com/courses/python-beginner-BxUFN/2/2?curriculum_id=4f89dab3d788890003000096# help would be aprichiated :slight_smile:


#6

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