How do I check if x has more or less than seven integers?
<pre><code>x = []
y = int(input("Hello, please enter your date of birth in this format: DDMMYYYY"))
x.append(y)
b = len.x()
if b &gt; 7:
    input("Please enter your date of birth correctly in the above format")
elif b &lt; 7:
    input("Please enter your date of birth correctly in the above format")
</code></pre>

<p>At the moment I'm getting this error:    </p>

<blockquote>
  <p>b = len.x() </p>
  
  <p>AttributeError: 'builtin_function_or_method' object has no
  attribute 'x'</p>
</blockquote>

<p>Sorry, I'm quite new to python, thanks for all the help!</p>

<p>Python'a <code>len()</code> is a <strong>function</strong>. It does not work like you think it does. What you doing is incorrect. Instead of this:</p>

<p><code>b = len.x()</code></p>

<p>Do this:</p>

<p><code>b = len(str(x))</code></p>

<p>You seem to be confused about the <code>len()</code> function. I suggest you read the <a href="https://docs.python.org/3/library/functions.html#len" rel="nofollow">Python documentation</a> about it.</p>

python python-3.x