+ 1
len()
Why here answer is 5? not 3 or 7 S='A\nB\tC' print(len(S)) output:5
4 odpowiedzi
+ 5
𝕾𝖆𝖌𝖆 he thought \n and \t didn't count
+ 2
S='A\nB\tC'#interpreter consider \n and \t as singler character so you are getting 5
print(len(S))
S=r'A\nB\tC'#note row string indicator r so for that you will get len as 7 because interprter \ and n as seperate character same for \t
print(len(S))
How are you expecting 3 here?
+ 1
Ohh, I understand already 𝕾𝖆𝖌𝖆 . Thank u very much
+ 1
tardigrade No problem. Nice question.