You are viewing a single comment's thread. Return to all comments →
here he compared the value of 1st index in s with "append"
so if user type ------> append 3 , then this 'if' condition will work
and in lis.append(int(s[1])) he typecasted the 2nd input into
integer, since he's taking input in form of string .
NOTE - input() by default take input as string,
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Lists
You are viewing a single comment's thread. Return to all comments →
here he compared the value of 1st index in s with "append"
so if user type ------> append 3 , then this 'if' condition will work
and in lis.append(int(s[1])) he typecasted the 2nd input into
integer, since he's taking input in form of string .
NOTE - input() by default take input as string,