You can use the sys module to get the command-line arguments passed to the code. "sys.argv" captures all arguments including the program name. The first argument is always the program name itself.
Here is the code with the sys module. You can pass as many arguments as you want to this code. From index 1 to the end, values will represent all arguments.
import sys
# Get all the arguments passed to the script (the first one is the script name itself)
args = sys.argv
# print arguments
if len(args) == 1:
print("No arguments other name program name passed")
else:
print("arguments passed are: ", args[1:])