PCAP Exam QuestionsBrowse all questions from this exam

PCAP Exam - Question 11


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

Show Answer
Correct Answer: AC

AC

Discussion

14 comments
Sign in to comment
ivanbicalhoOptions: AC
Feb 19, 2023

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
May 16, 2022

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
May 3, 2022

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

666_mOptions: AC
May 5, 2022

A & C is correct.

JO5HOptions: AC
Sep 28, 2022

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

yuv322Options: AD
May 2, 2022

A & D Are the correct answers.

JnanadaOptions: AC
Aug 18, 2022

Correct Answer is A C

BaldridgeOptions: AC
May 31, 2022

A C are correct

beshaOptions: AC
Jul 2, 2022

Correct answer is A C

naveenbv80Options: AC
Dec 2, 2022

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

greyhats13Options: AC
Jan 2, 2023

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

AmcalOptions: AC
Mar 14, 2023

A and C are correct

rodanielbOptions: AD
Aug 5, 2023

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

seaverickOptions: AC
Jan 27, 2024

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