How to set an optional argument from python in terminal?
Question: I have a program that takes one input but can also take another optional
argument if the user wants. How can I implement this optional argument?

I am importing sys library to get the first arguement like this

    
    
    word_input = sys.argv[1]
    num_input = sys.argv[2] // I want to make this optional
    


Answer: Test for the length; `sys.argv` is just a list, really:

    
    
    num_input = sys.argv[2] if len(sys.argv) > 2 else None
    

