title: What is the difference between s.lower().count("earth") and s.upper().count("Earth")?
body: <p>Today I received a task to count word &quot;earth&quot; in a text using python-3. I know for sure that I have to use <code>s.count</code> but in text the word is written in both upper and lower registers. I found out that <code>s.lower().count(&quot;earth&quot;)</code> is what I need, but I don't understand why <code>s.upper().count(&quot;earth&quot;)</code> or <code>s.lower().count(&quot;Earth&quot;)</code> or <code>s.upper().count(&quot;Earth&quot;)</code> do not? I just need an explanation. Here is the text:</p>
  <pre><code>s = &quot;In a distant, but not so unrealistic, future\
   where mankind has abandoned earth because it has\
   become covered with trash from products sold by\
   the powerful multi-national Buy N Large corporation,\
   WALLE, a garbage collecting robot has been left to\
   clean up the mess. Mesmerized with trinkets of Earth's\
   history and show tunes, WALLE is alone on Earth except\
   for a sprightly pet cockroach. One day, EVE, a sleek\
   (and dangerous) reconnaissance robot, is sent to Earth to\
   find proof that life is once again sustainable.&quot;
  </code></pre>