Python Programming - Console Input/Output - Discussion

Discussion Forum : Console Input/Output - General Questions (Q.No. 55)
55.
How can you read a line of text from the console, remove leading and trailing whitespaces, and convert it to uppercase?
text = input().trim().upper()
text = input().strip().uppercase()
text = input().strip().upper()
text = input().trim().uppercase()
Answer: Option
Explanation:
To read a line of text from the console, remove leading and trailing whitespaces, and convert it to uppercase, use input().strip().upper().
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.