• Python question of the day

    What would be the output of executing the following code:
    str1 = 'a quick red fox'
     of der kciuq a
    In str1[-2::str1.count('k')] start is -2 (-1 is x -2 is o so start is at o) end is default as there no value for end point (default is end of the string, so x here) step size is 1 as there is only one k in the string, so the slice is ox (starting from second element from last and till last in steps of 1)

    Top 100 python interview questions:

datai analytics