how to take multiple chracter in argv in python
Question: i am new in python3 and currently learning it i have written small code below.
i want to know that why argv is taking single character only? for every
variable. isn't it supposed to take whole string(multiple characters)? in
other words when i input in console it only hold four single characters. every
variable have just one character.

    
    
    from sys import argv
    
    def main(argv): 
    
        script, first, second, third = argv
        print ("The script is called:", script)
        print ("Your first variable is:", first)
        print ("Your second variable is:", second)
        print ("Your third variable is:", third)
    
    main(input())
    


Answer: If you're trying to get arguments from the command line, `main` doesn't need a
parameter, and you don't need to call `input`. You're merely overwriting
`sys.argv` when you do that.

    
    
    from sys import argv
    
    def main(): 
    
        script, first, second, third = argv
        print ("The script is called:", script)
        print ("Your first variable is:", first)
        print ("Your second variable is:", second)
        print ("Your third variable is:", third)
    
    main()
    

Result:

    
    
    C:\Users\kevin\programs>py -3 test.py hurf durf klurf
    The script is called: test.py
    Your first variable is: hurf
    Your second variable is: durf
    Your third variable is: klurf
    

* * *

Alternatively, if you really _do_ want to get information from `input`, and
you just got confused reading about argv, then you can use `split` to get
words from the input string rather than letters. Of course, you can't get the
script's name this way.

    
    
    def main(data): 
    
        script, first, second, third = data.split()
        print ("The script is called:", script)
        print ("Your first variable is:", first)
        print ("Your second variable is:", second)
        print ("Your third variable is:", third)
    
    main(input("Enter some data: "))
    

Result:

    
    
    Enter some data: hello how are you?
    The script is called: hello
    Your first variable is: how
    Your second variable is: are
    Your third variable is: you?
    

