def add(x, y): x += y return x a = 5 b = 3 c = add(a, b) print(a) ————————————— A- 8 B- 5 C- 3 D- Error #Python #برمجة
2
0
1
2
937
Hi .. py beginner. Pydroid3 gives answer 5. Is that correct, pls advise or reference. I thought it wld add x(5) to y(3) giving 8 and put 8 back in x returning 8 as answer. Wheres the flaw in my thinking please. If answer is 5 then why hasn't x been incremented. thanks. G
0
0
0
0
73
United States Trendy
- 1. Kansas 21.4K posts
- 2. Missouri 7,779 posts
- 3. Arrowhead 5,445 posts
- 4. Jeff McNeil 3,525 posts
- 5. Vince Zampella 19.4K posts
- 6. Clark Hunt 1,311 posts
- 7. Olathe N/A
- 8. Token "F" N/A
- 9. Titanfall 3,781 posts
- 10. Call of Duty 21.4K posts
- 11. Jackson County 1,374 posts
- 12. #Fliffmas 1,907 posts
- 13. 60 Minutes 149K posts
- 14. KCMO N/A
- 15. Utah State 1,975 posts
- 16. Laura Kelly N/A
- 17. Zimbabwe 24.8K posts
- 18. Greenland 40.2K posts
- 19. Kittle 2,212 posts
- 20. Wyandotte County N/A
Loading...
Something went wrong.
Something went wrong.