Computer Science
Which method removes all the trailing whitespaces from the right of the string?
- tolower()
- upper()
- Istrip()
- rstrip()
Python String Manipulation
1 Like
Answer
rstrip()
Reason — The rstrip() function removes all the trailing whitespaces from the right of the string.
Answered By
3 Likes
Related Questions
What will be the output of the following code?
str1= "I love Python." strlen = len(str1) print(strlen)- 9
- 29
- 14
- 3
What will be the output of the following code?
Str1= 'My name is Nandini ' Str2 = Str1[3:7] strlen = len(Str2) print(strlen)- 4
- 14
- 24
- 34
To concatenate means to …………… .
- replicate
- join
- split
- multiply
…………… function will always return tuple of 3 elements.
- index()
- split()
- partition()
- strip()