Which of the following can be called a parallel array implementation? [

2025

Which of the following can be called a parallel array implementation? [

  1. A.

    firstName = ['Joe','Bob','Frank','Hans']

    lastName = ['Smith','Seger','Sinatra','Schultze']

    heightInCM = [169,158,201,199]

    for i in xrange(len(firstName)):

    print "Name:",firstName[i], lastName[i]

    print "Height in CM:,",heightInCM[i]

  2. B.

    firstName = ['Joe','Bob','Frank','Hans']

    lastName = ['Smith','Seger']

    heightInCM = [169,158]

    for i in xrange(len(firstName)):

    print "Name:",firstName[i], lastName[i]

    print "Height in CM:,",heightInCM[i]

  3. C.

    firstName = ['Joe','Bob']

    lastName = ['Smith','Seger','Sinatra','Schultze']

    heightInCM = [169,158]

    for i in xrange(len(firstName)):

    print "Name:",firstName[i], lastName[i]

    print "Height in CM:,",heightInCM[i]

  4. D.

    firstName = ['Joe','Bob']

    lastName = ['Smith','Seger' ,'Schultze']

    heightInCM = [169,158]

    for i in xrange(len(firstName)):

    print "Name:",firstName[i], lastName[i]

    print "Height in CM:,",heightInCM[i]

Attempted by 85 students.

Show answer & explanation

Correct answer: A

Answer: a

Explanation: All the arrays must have equal length, that is, contain same number of elements.

Explore the full course: Amcat Preparation