• + 1 comment

    Can you pls explain, what does the line

    s=input().strip().split(" ")

    does to the code. I am a noob and I find it hard to understand what does that line mean

    • + 0 comments

      This line tries to strip (the whitespace in front/ at the end) and seperate the command you receive from the input.

      For example, if the command is " append 1". The strip() makes it "append 1", the unnecessary space in front is taken out. Whereas function split(" ") uses space as seperator and split it into two words "append" and "1".