string.upper(<str>) and <str>.upper() won't execute
问题 I have the following bit of code: def test(): fragment = '' fragment = raw_input('Enter input') while fragment not in string.ascii_letters: fragment = raw_input('Invalid character entered, try again: ') fragment.upper() print fragment*3 However when I run it, say for an input value of p , fragment gets printed as 'ppp' - all lower case, i.e. the fragment.upper() line does not run. The same thing happens if I replace that line with string.upper(fragment) (and adding import string at the