title: How to determine if a number is a binary or not?
body: <p><code>my_l1:str = &quot;0101011&quot;</code></p>
  <p>I execute this code:</p>
  <pre><code>for character in my_l1:
      if character != '0' and character != '1':
         print (f&quot;{my_l1} is not a binary number&quot;)
      else:
         print(f&quot;{my_l1} is a binary number&quot;)
  </code></pre>
  <p>and I get this output:</p>
  <pre><code>0101011 is a binary number
  0101011 is a binary number
  0101011 is a binary number
  0101011 is a binary number
  0101011 is a binary number
  0101011 is a binary number
  0101011 is a binary number
  </code></pre>
  <p>How do I get just a single line output which goes like this?</p>
  <pre><code>0101011 is a binary number.
  </code></pre>