Python Inner For Loop Not Going To Else Statment

Minor adjustment, note that the range(0,1) function only creates a iterator with one value being 0. So it counts up until (but not included) 1.

#variable declarations
array_value = str
#declares the two dimensional array as a string
Zoo_Animal = [["", ""], ["",""], ["",""], ["",""], ["",""], ["",""]]
#loading the array
for row in range(0,6,1):
    for column in range(0,2):
        #determining the input statement
        if column == 0:
            array_value = input("Enter the name of a Zoo animal: ")
        else:
            array_value = input("Enter where the animal came from: ")
        #end if
          #adding the input value to the array
        Zoo_Animal[row][column] = array_value
    #end For
#end For
print(Zoo_Animal)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top