The error
The string methods
Error:IndexError: list index out of range
is because your loopwhile i <= len(temp):is going one time too many, reduce the len condition by 1
The string methods
upper
and replace
do not alter the original string, it returns an altered copy which is what then needs putting back into your list.