Find the error. Following code intends to create a
tuple with three identical strings. But even after
successfully executing following code (No error
reported by Python), The len() returns a value
different from 3. Why?
tup1 = ("Mega")* 3
print(len(tup1))
in Python
Answers
Answered by
1
Because the 3 is multiplied directly to the str "Mega" and is repeated 3 times over and length of the obtained str is returned by len( ) which is more than 3.
Answered by
1
this is the answer with full image
Attachments:
![](https://hi-static.z-dn.net/files/d6e/38e6e786bf5d4ee00d21bd0c8c98d418.jpg)
Similar questions