Computer Science, asked by ganeshparking, 7 months ago

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 Oreki
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 Omkarborde100
1

this is the answer with full image

Attachments:
Similar questions