How to ignore lower as well upper case of a word in python?
<p>I want to find <strong>Andy</strong> in the list. Either <strong>Andy</strong> comes in upper or lower case in string the program should return <code>True</code> </p>

<pre><code>String1 ='Andy is an awesome bowler' 
String2 ='andy is an awesome bowler'
String3 ='ANDY is an awesome bowler'
</code></pre>

<p>I am doing in this way</p>

<pre><code>if 'Andy' in String1:
   print ('success')
else:
    print("Nothing")
</code></pre>

<p>But it is working only for <code>Andy</code> not for <code>andy</code> or <code>ANDY</code>. I do not want to use <code>Pattern</code> matching.  By using <code>lower()</code> the <code>Andy</code> can be converted to lower case but I need both at a time ignoring lower as well as upper case. Is it possible? </p>

<p>You can convert the string to uppercase or lowercase first:</p>

<pre><code>String1 ='Andy is an awesome bowler' 
String2 ='andy is an awesome bowler'
String3 ='ANDY is an awesome bowler'

if 'andy' in String1.lower(): # or this could be if 'ANDY' in String1.upper():
    print('success')
else:
    print('Nothing')
</code></pre>

python