Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

'int' object has no attribute 'digits'

Hello all,

When I run the following two lines of code,

for j in range(3,4):
   print j.digits(3)

I get the error message

AttributeError: 'int' object has no attribute 'digits'

However, the following two lines give the expected outcome [0,1]:

j=3 
j.digits(3)

What can be wrong?

Thanks in advance!