-3

The overall goal of this program is to count the occurrences of a word that the user inputs. To do this I need all of the words in this long string to be lowercase. I do not want to print the entire string with

print s.lower()

I just want this to actually change the string to lowercase without printing it out.

  • 1
    I don't think this is a bad question; it can be confusing when you don't know the difference between mutable and immutable objects. – Cody Piersall Feb 14 '14 at 01:34
  • Perfect! For some reason using s = s.lower() wasn't working a few minutes ago, but it's fixed now! – user3295539 Feb 14 '14 at 01:35

2 Answers2

3

I don't know what language this is, but presumably, you have to do this:

s = s.lower()
kabb
  • 2,474
  • 2
  • 17
  • 24
0

Just assign it to a new string.

lower = s.lower()
jayelm
  • 7,236
  • 5
  • 43
  • 61
George Philip
  • 704
  • 6
  • 21