It’s alive!

Report a typo

Frankenstein's creature needs to be revived by electric current every 25 years. Нe has been living for 357 years. You have an array that stores the voltage used to revive Frankenstein's creature. What will this program output when a=[677,591,153,356,617,337,195,948,440,657,631,546,148,678]a = [677, 591, 153, 356, 617, 337, 195, 948, 440, 657, 631, 546, 148, 678]?

function alive(a):
    found_even = false
    min_even = infinity

    for i in (1, len(a)):
        if a[i] mod 2 == 0:
            found_even = true
            if a[i] < min_even:
                min_even = a[i]

    if found_even:
        print(min_even)
    else:
        print(0)
Enter a number
___

Create a free account to access the full topic