Given a string s = “Welcome”, which of the following code is incorrect?
(A) print s[0]
(B) print s.lower()
(C) s[1] = ‘r’
(D) print s.strip()
Answer: (C)
Explanation: strings are immutable in Python
Quiz of this Question
Please comment below if you find anything wrong in the above post
Recommended Posts:
- Python | Miscellaneous | Question 1
- Python | Miscellaneous | Question 2
- Python | Miscellaneous | Question 3
- Python | Miscellaneous | Question 4
- Python | Miscellaneous | Question 5
- Python | Miscellaneous | Question 6
- Python-Quizzes | Miscellaneous | Question 8
- Python-Quizzes | Miscellaneous | Question 9
- Python-Quizzes | Miscellaneous | Question 10
- Python | Functions | Question 1
- Python | Functions | Question 2
- Python | Functions | Question 3
- Python | Functions | Question 4
- Python | Functions | Question 5
- Python | Functions | Question 6
- Python | Functions | Question 7
- Python | Operators | Question 1
- Python | Operators | Question 2
- Python | Operators | Question 3
- Python | Operators | Question 4

