a=("\nHello")
print(len(a))
The intended output is a new line with 5 printed but instead there is no new line and the length is coming out to be 6.
a=("\nHello")
print(len(a))
The intended output is a new line with 5 printed but instead there is no new line and the length is coming out to be 6.
There is a new line printed, plus the 5 characters in 'Hello', that's 6 in total:
a = "\nHello"
print(a)
print("Total length is", len(a))
Output
<space>
Hello
Total length is 6