Which of the following can be called a parallel array implementation? [
2025
Which of the following can be called a parallel array implementation? [
- 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]
- 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]
- 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]
- 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.