79117791

Date: 2024-10-23 12:01:31
Score: 2.5
Natty:
Report link

Is that what you meant?

Output:

I am first apple
I am second cherry
I am third banana
I am first apple
I am second cherry
I am third banana
I am first apple
I am second cherry
I am third banana

Code:

def main_func():
fruits = ["apple", "cherry", "banana"]

for index, fruit in enumerate(fruits):
    def first():
        print("I am first", fruit)

    def second():
        print("I am second", fruit)

    def third():
        print("I am third", fruit)
    
    if index == 0:
        first()
    elif index == 1:
        second()
    else:
        third()

for i in range(3):
    main_func()
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): Is that
  • Low reputation (1):
Posted by: Kempeter