Python Quiz #2 What is the output of this code snippet? A) 20 90 100 B) 20 20 20 C) 10 100 110 D) None of the above Answer for Quiz #1 in the thread 🧵👇
Solution for Quiz #1 Please watch the video till the end and let me know your thoughts. youtu.be/PmBxcXpoocE
That's a wrap! I hope you learnt something new today. Follow me @python_spaces for more such content. Like and RT the first tweet to share with your friends. Cheers 🎉
Here is Quiz #1, if you haven't see
Python Quiz #1 What is the output of this code snippet? A) Error B) ['Python, 'Go'] C) ['Python', 'G', 'o'] D) None of the above
A is my answer, reply me the correct answer if I am wrong.
A) 20 90 100 This should help you understand why 👇
20, 90, 100... Number picks the latest value assigned. Func prints 90 since it's default is 0. Func(10) prints 100..hope my python awareness class is worth it...lol
A) 20 90 100 Explain: In print function, 1st number variable value is 20 as it is reassigned globally after assigning value to 10. 2nd func() execute function with number=0 value and code return (0+90=90) output 3rd func(10) provides number=10 as input and return (10+90=100)
The biggest take on this quiz, would be keyword arguments can only be declared after positional arguments
United States Trendy
- 1. Godzilla 23.7K posts
- 2. Lamine 59.3K posts
- 3. Barca 95.8K posts
- 4. Brujas 22.5K posts
- 5. Trench 7,248 posts
- 6. Barcelona 145K posts
- 7. Brugge 44K posts
- 8. $DUOL 2,261 posts
- 9. Shabbat 2,213 posts
- 10. Foden 19.4K posts
- 11. Richardson 3,354 posts
- 12. Flick 35.2K posts
- 13. Frey 26.2K posts
- 14. Jared Golden 1,702 posts
- 15. Anthony Taylor 1,632 posts
- 16. Balde 12.1K posts
- 17. Lina Khan 6,718 posts
- 18. Hefner 1,187 posts
- 19. Minneapolis 58.4K posts
- 20. Fermin 11.1K posts
Something went wrong.
Something went wrong.