I'm trying to make a program in Python 3 that should turn typed text into uppercase and remove white space. I would like to know what is wrong with my code since it is not deleting the blanks. I tested two codes.
-
First code:
print ("-"*50) print ("-"*50) frase = input("\nEscreva uma frase: ") frase = frase.upper() frase = frase.strip() print ("\n",frase) print ("-"*50) print ("-"*50)
-
Second Code
print ("-"*50) print ("-"*50) frase = input("\nEscreva uma frase: ") frase = frase.upper() frase = frase.replace('','') print ("\n",frase) print ("-"*50) print ("-"*50)