2

I write some code

i don't know why my string doesn't changed

although i'm use upper method

def Input():
        a = input('Type Anything\n')
        print('\n')
        a.upper()
        print(a)
Input()
whoami
  • 117
  • 8
  • sorry everybody, im not duplicated anything. i don't know if there anything like my question. Sorry everyone :) – whoami May 10 '19 at 02:50
  • I am voting to reopen this because it is not a duplicate of https://stackoverflow.com/questions/6797984/how-do-i-lowercase-a-string-in-python – Ruzihm May 15 '19 at 05:45
  • Ok, Just open that. i am new at here. :) – whoami May 15 '19 at 07:36

1 Answers1

5

a.upper() returns a string in Upper case. So you will have to assign this back to the variable a.

def Input():
    a = input('Type Anything\n')
    print('\n')
    a = a.upper()
    print(a)
Input()
Nithin
  • 1,005
  • 8
  • 14