For a given list, x = [21, ‘hello,’cream’, 20,19,’village’], using for loop to iterate over the items and using - if statement print the items that are of type int
for i in range(len(sequence)):
element = sequence[i]
if type(element) == int:
print(element)
Try this code , see if it works.
no maam I did not get the answer it showing error