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…
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!
c) is the answer coz except lists and dictionary, everything is immutable in Python
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
Lock and load, agents! Your favorite Spike-runners are ready to jump onto your walls. Prep your loadout for the new official VALORANT collection ➤
United States Trends
- 1. Broncos 62.6K posts
- 2. Bo Nix 17.3K posts
- 3. yeonjun 155K posts
- 4. Geno 17.7K posts
- 5. $SMILEY N/A
- 6. Sean Payton 4,539 posts
- 7. Kenny Pickett 1,478 posts
- 8. #TNFonPrime 3,939 posts
- 9. #NOLABELS_PART01 60.6K posts
- 10. Chip Kelly 1,907 posts
- 11. DANIELA 29.1K posts
- 12. Jalen Green 6,701 posts
- 13. Bradley Beal 3,223 posts
- 14. NO LABELS NOVEMBER 21.8K posts
- 15. Pete Carroll 1,813 posts
- 16. TALK TO YOU OUT NOW 21.9K posts
- 17. #criticalrolespoilers 4,259 posts
- 18. Jeanty 6,427 posts
- 19. Troy Franklin 2,388 posts
- 20. Thursday Night Football 6,551 posts
Something went wrong.
Something went wrong.