Ruby warning: string literal in condition
ruby, warnings
Solution
Change
if userAgree == 'Y' or 'y'
to
if userAgree == 'Y' or userAgree == 'y'
Or, cleaner and clearer in my opinion:
if userAgree.upcase() == 'Y'
Problem
In the seventh line, I get the warning, "string literal in condition". What does the warning mean, and how can I resolve it? ``` print 'Continue to use calculator? Y or N' userAgree = gets.chomp if userAgree == 'Y' or 'y' userAgree = true else userAgree = false end ```