#pythongotcha search results
Ah, the classic mutability trap! Both lists point to the same object—like two names for one dog. Change one, the other barks differently. Output: [9, 2, 3, 4]. Shared fate! 🐶🔧 #PythonGotcha
Wah, jebakan klasik Python nih—instance variable nyelonong ganti class var! Aku dulu pasti jawab 10 10 10 sambil pede, eh ternyata 10 5 5. Siapa lagi yang pernah kena prank gini pas interview? 😆 #PythonGotcha #CodingQuiz
What will be the output of the following Python code? class Test: x = 5 t1 = Test() t2 = Test() t1.x = 10 print(t1.x, t2.x, Test.x)
#pythongotcha : als je een int deelt door een int, krijg je een int: 14/5=2, terwijl met floats 14.0/5.0=2.799..
Q4 Ans: [1,2,3,4,5,6] The default arg, “my_list”, is mutable, so it isn't instantiated with every function call Calling the fn twice adds the other args to the same list instance each time Don't use mutable types as default args! #ManGroupPyQuiz #pythongotcha
Q8 Ans: 12 1 123 1 The += operator only uses the __iadd__ method if it exists. Strings are immutable so do not have __iadd__ therefore lines 3 and 7 are equivalent #ManGroupPyQuiz #pythonquiz #pythongotcha
Wah, jebakan klasik Python nih—instance variable nyelonong ganti class var! Aku dulu pasti jawab 10 10 10 sambil pede, eh ternyata 10 5 5. Siapa lagi yang pernah kena prank gini pas interview? 😆 #PythonGotcha #CodingQuiz
What will be the output of the following Python code? class Test: x = 5 t1 = Test() t2 = Test() t1.x = 10 print(t1.x, t2.x, Test.x)
Ah, the classic mutability trap! Both lists point to the same object—like two names for one dog. Change one, the other barks differently. Output: [9, 2, 3, 4]. Shared fate! 🐶🔧 #PythonGotcha
Q8 Ans: 12 1 123 1 The += operator only uses the __iadd__ method if it exists. Strings are immutable so do not have __iadd__ therefore lines 3 and 7 are equivalent #ManGroupPyQuiz #pythonquiz #pythongotcha
Q4 Ans: [1,2,3,4,5,6] The default arg, “my_list”, is mutable, so it isn't instantiated with every function call Calling the fn twice adds the other args to the same list instance each time Don't use mutable types as default args! #ManGroupPyQuiz #pythongotcha
#pythongotcha : als je een int deelt door een int, krijg je een int: 14/5=2, terwijl met floats 14.0/5.0=2.799..
Something went wrong.
Something went wrong.
United States Trends
- 1. #GMMTV2026 3.7M posts
- 2. Good Tuesday 34.4K posts
- 3. MILKLOVE BORN TO SHINE 545K posts
- 4. #NuestraBanderaEsBolívar 2,169 posts
- 5. #tuesdayvibe 2,596 posts
- 6. Taco Tuesday 12.1K posts
- 7. WILLIAMEST MAGIC VIBES 86.8K posts
- 8. Alan Dershowitz 3,954 posts
- 9. Happy Thanksgiving 17.8K posts
- 10. Mark Kelly 228K posts
- 11. Mainz Biomed N.V. N/A
- 12. University of Minnesota N/A
- 13. Praying for Pedro N/A
- 14. Enron 1,835 posts
- 15. Hegseth 107K posts
- 16. #25Nov 2,427 posts
- 17. #DittoSeries 102K posts
- 18. Chelsea 237K posts
- 19. JOSSGAWIN MAGIC VIBES 32.8K posts
- 20. Maddow 17.5K posts