Python provides a way to create list with different conditions. Read more about list comprehensions and how you can use them.
This is a very basic program you can implement more programs to understand it in depth.
A very important Job of a DevOps person can be creating CLI applications. CLI applications are those which can run from terminal with some commands.
Click is a great framework to write such applications in python. Read about the click framework
Task 2: Write a CLI application to check if a passed url as arguement is return 200 status code or not.
You can use CLICK and REQUESTS module to accomplish this.
Task 3: Write a CLI application which takes git URL as arguement pulls the code and run security checks using safety module of python on it.
Structure your code properly. Use functions.