Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam PCAP All Questions

View all questions & answers for the PCAP exam

Exam PCAP topic 1 question 12 discussion

Actual exam question from Python Institute's PCAP
Question #: 12
Topic #: 1
[All PCAP Questions]

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

  • A. len(a)== len (b)
  • B. a [0]-1 ==b [0]
  • C. a [0]== b [0]
  • D. b [0] - 1 ==a [0]
Show Suggested Answer Hide Answer
Suggested Answer: CD 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
FarukhJamal
Highly Voted 3 years, 2 months ago
In question, he asked for False equations. so Ans: C and D. because A and B are True
upvoted 20 times
...
rodanielb
Most Recent 1 year, 3 months ago
Selected Answer: CD
After executing the snippet: a = a[0] = 1 b = b[0] = 0
upvoted 2 times
...
Ello2023
1 year, 6 months ago
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.
upvoted 1 times
...
Amcal
1 year, 8 months ago
C and D
upvoted 1 times
...
ivanbicalho
1 year, 9 months ago
Selected Answer: CD
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
upvoted 2 times
...
MherSimonyan
1 year, 9 months ago
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
upvoted 1 times
...
naveenbv80
1 year, 12 months ago
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
upvoted 1 times
...
Jnanada
2 years, 3 months ago
Correct Answer should be C and D as the question says which equations are False
upvoted 1 times
...
PremJaguar
2 years, 4 months ago
Selected Answer: CD
These answers are wrong, c and d are right
upvoted 1 times
...
macxsz
2 years, 7 months ago
Selected Answer: CD
these two are false: C. a [0]== b [0] D. b [0] - 1 ==a [0]
upvoted 3 times
...
japimil
2 years, 7 months ago
Selected Answer: CD
ask about false ones
upvoted 1 times
...
AlMargoi
2 years, 8 months ago
Selected Answer: CD
Should be C, D.
upvoted 1 times
...
rocky48
2 years, 8 months ago
Selected Answer: CD
>>> len(a)==len(b) True >>> a [0]-1 ==b[0] True >>> a [0]== b [0] False >>> b [0] - 1 ==a [0] False
upvoted 1 times
...
Kuzymir
2 years, 9 months ago
Selected Answer: CD
False are C & D
upvoted 1 times
...
GioGiunta
2 years, 9 months ago
Selected Answer: CD
answer should be C and D, it's asking for False not True
upvoted 1 times
...
diazed
2 years, 10 months ago
Selected Answer: CD
C & D are the correct answers
upvoted 2 times
...
xsaints
3 years ago
why are answers given incorrect? was asking for false, instead trues were given (?)
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...