Python Error – int object has no attribute

As time = 3 is declared as an integer, time.time doesn’t have any sense since time is int variable (that isn’t a class but a primitive data type). I suppose that you expected to call time (module) writing time but, since you’re redefining it as an integer, this last definition shadows the time module

Change time variable name to something else, like myTime

Error messages are usefull, you should read them. Often the answer is contained directly into this errors/warning messages

Leave a Comment