Python Question / Quiz; What is the output of the following Python code, and why? 🤔🚀 Comment your answers below! 👇 #python #programming #developer #programmer #coding #coder #softwaredeveloper #computerscience #webdev #webdeveloper #webdevelopment #pythonprogramming…

Stream, call, game, and work in even the most remote locations. Order online in minutes
C. Error (TypeError) Strings are immutable. You can't change individual characters. For beginners: › text[1] = 'i' fails › text = text[:1] + 'i' + text[2:] works › text = text.replace('e', 'i', 1) works To modify strings, create a new one!
The answer is (C) First of all 'text' is a string which is immutable (can't be changed after declaring.) Second, 'text[1]' will expect a list which will also through an error.
Strings are immutable, so you cannot change a character of a string like that. Answer C) Error
c) is the answer coz except lists and dictionary, everything is immutable in Python
Can you beat the average IQ (98)? Take the test now and find out!
United States Trends
- 1. Columbus 137K posts
- 2. President Trump 1.03M posts
- 3. Middle East 232K posts
- 4. #IndigenousPeoplesDay 9,408 posts
- 5. #WWERaw 51.3K posts
- 6. Seth 46.2K posts
- 7. Thanksgiving 53.9K posts
- 8. $BURU 1,043 posts
- 9. Marc 46.8K posts
- 10. Macron 205K posts
- 11. Darius Smith 3,381 posts
- 12. HAZBINTOOZ 3,640 posts
- 13. Apple TV 4,778 posts
- 14. Mike Shildt 1,971 posts
- 15. Egypt 241K posts
- 16. Flip 53.3K posts
- 17. #drwfirstgoal N/A
- 18. #IDontWantToOverreactBUT 1,322 posts
- 19. Kash Doll N/A
- 20. Bochy N/A
Something went wrong.
Something went wrong.