79205932

Date: 2024-11-20 05:46:35
Score: 1
Natty:
Report link

Well, I finally figured out the answer to this. I had to use a while loop and not count the first iteration of the first type. I did that by setting the index to 1.

typeFirst = type(tpl[0])

index = 1
count = 0

while index < len(tpl):
    if type(tpl[index]) == typeFirst:
        count += 1
    index += 1

print(count)
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Boiledbiscuit