Computer Science
What will be the output of the following code?
A = 'Virtual Reality'
A.replace('Virtual', 'Augmented')
- Virtual Augmented
- Reality Augmented
- Augmented Virtual
- Augmented Reality
Python String Manipulation
3 Likes
Answer
Augmented Reality
Reason — The replace() method creates and returns a new string with the specified substring replaced, without altering the original string. In this case, 'Virtual' is replaced by 'Augmented', resulting in 'Augmented Reality'.
Answered By
2 Likes
Related Questions
To concatenate means to …………… .
- replicate
- join
- split
- multiply
…………… function will always return tuple of 3 elements.
- index()
- split()
- partition()
- strip()
What will be the output of the following?
print("ComputerScience".split("er", 2))- ["Computer", "Science"]
- ["Comput", "Science"]
- ["Comput", "erScience"]
- ["Comput", "er", "Science"]
What is the ASCII equivalent decimal no. for 'Y'?
- 87
- 88
- 89
- 90