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
United States 趨勢
- 1. Good Saturday 19.7K posts
- 2. Tottenham 47.1K posts
- 3. #SaturdayVibes 2,868 posts
- 4. #LingOrm1st_ImpactFANCON 1.48M posts
- 5. LINGORM HER AND HERS FANCON 1.4M posts
- 6. Manchester United 56.4K posts
- 7. #KirbyAirRiders 2,025 posts
- 8. Brown Jackson 6,393 posts
- 9. Justice Jackson 6,797 posts
- 10. Collar 17.4K posts
- 11. Frankenstein 86.6K posts
- 12. Capitol Police 41.9K posts
- 13. Giulia 16.4K posts
- 14. The Supreme Court 149K posts
- 15. Heels 31.5K posts
- 16. Tulane 4,621 posts
- 17. Snoop Dogg 3,318 posts
- 18. Lindsey 9,419 posts
- 19. Pluribus 31.9K posts
- 20. Hungary 61.3K posts
Something went wrong.
Something went wrong.