Removed the code block that opens 'viewed.txt' for writing.
Simplified the else condition to only reset the viewed_list to an empty list.
The previous implementation unnecessarily performed a file write operation, which could lead to potential performance issues and unnecessary I/O operations.
This change ensures that the viewed_list is reset without affecting file I/O, improving the efficiency of the code.
No functional impact expected as the viewed_list is still reset correctly.
No functional impact expected as the viewed_list is still reset correctly.