Discussion Room : IDC101

Queries / doubts

Re: Queries / doubts

द्वारा Rutvik Kayastha -
उत्तरों की संख्याः 0

As per my simple observations,

s = "Python is great."

  1. print s[2] = t ,print s[2][1] will be absured because "print s[2]" have only 1 char in output. so print s[2][0] will only work.
  2. print s[::-1]=.taerg si nohtyP ,print s[::-1][::-1] will do again do that operation on output so we will get original string inverted back.
  3. so, second bracket applies specified operation in it, on output of first bracket.

संलग्नक My work 1.JPG