PCAP Exam QuestionsBrowse all questions from this exam

PCAP Exam - Question 12


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

Show Answer
Correct Answer: AB

AB

Discussion

17 comments
Sign in to comment
FarukhJamalOptions: CD
Sep 29, 2021

In question, he asked for False equations. so Ans: C and D. because A and B are True

macxszOptions: CD
May 3, 2022

these two are false: C. a [0]== b [0] D. b [0] - 1 ==a [0]

xsaintsOptions: AB
Nov 8, 2021

why are answers given incorrect? was asking for false, instead trues were given (?)

diazedOptions: CD
Jan 19, 2022

C & D are the correct answers

ivanbicalhoOptions: CD
Feb 19, 2023

AB is true, but the question asks for the False ones, so: CD When you have an array in a variable and set it to another variable, they share the same id: a = [1] b = a print(id(a), id(b)) #same id BUT, unlike the previous question, when you do this: a = [1] b = a[:] # [start:stop:step] b has now a different id, that means it is a different array

rodanielbOptions: CD
Aug 5, 2023

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

GioGiuntaOptions: CD
Feb 4, 2022

answer should be C and D, it's asking for False not True

KuzymirOptions: CD
Mar 1, 2022

False are C & D

rocky48Options: CD
Mar 19, 2022

>>> len(a)==len(b) True >>> a [0]-1 ==b[0] True >>> a [0]== b [0] False >>> b [0] - 1 ==a [0] False

AlMargoiOptions: CD
Mar 28, 2022

Should be C, D.

japimilOptions: CD
Apr 20, 2022

ask about false ones

PremJaguarOptions: CD
Jul 18, 2022

These answers are wrong, c and d are right

JnanadaOptions: CD
Aug 18, 2022

Correct Answer should be C and D as the question says which equations are False

naveenbv80Options: CD
Dec 2, 2022

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

MherSimonyanOptions: CD
Feb 14, 2023

Correct Answer should be C and D as the question says which equations are False a = [0] b = a[:] a[0] = 1 a[0] # is 1 b[0] # is 0 so: print(len(a) == len(b)) # => True print(a[0] - 1 == b[0]) # => True print(a[0] == b[0]) # => False print(b[0] - 1 == a[0]) # => False

AmcalOptions: CD
Mar 14, 2023

C and D

Ello2023
May 16, 2023

Lists [] are always mutable Tuples () are always immutable Therefore a and b will not stay the same as they are both lists compared to the previous question.