Python code snippets for simple tasks and interview questions