Exam PCAP All QuestionsBrowse all questions from this exam
Question 11

Assuming that the following snippet has been successfully executed, which of the equations are True? (Choose two.)

    Correct Answer: A, C

    AC

Discussion
ivanbicalhoOptions: AC

For you who thought it was AD, here is the explanation: When you have an array in a variable and set it to another variable, they share the same id, that means they point to the same array. a = [1] b = a print(id(a), id(b)) # same id Since a==b, when you set a[0] = 0, you are "also" doing b[0] = 0

rbishunOptions: AC

A and C are correct. a = [1] b = a a[0] = 0 print(len(a) == len(b)) # True print(a[0] == b[0]) # True

macxszOptions: AC

a and b are the same list A. len(a) == len (b) C. a [0] == b [0]

JO5HOptions: AC

The Answer is suprisingly A & C, i thought it was A & D until i tried it

666_mOptions: AC

A & C is correct.

JnanadaOptions: AC

Correct Answer is A C

yuv322Options: AD

A & D Are the correct answers.

seaverickOptions: AC

a=[1] b=a a[0]=0 print(len(a)==len(b))#True print(b[0]+1 == a[0])#False print(a[0] == b[0])#True print(a[0]+1 == b[0])#False Ans is A,C

rodanielbOptions: AD

After executing the snippet: a = a[0] = 0 b = b[0] = 1

AmcalOptions: AC

A and C are correct

greyhats13Options: AC

if you print(b[0]) it will print 0, so the answer is A and C.

naveenbv80Options: AC

a=[1] b=a a[0]=0 print(len(a) == len(b)) -> True print(a[0] == b[0]) --> True print(b[0] + 1 == a[0]) --> False print(a[0] + 1 == b[0]) --> False My answer is A and C

beshaOptions: AC

Correct answer is A C

BaldridgeOptions: AC

A C are correct