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, 6 months ago
In question, he asked for False equations. so Ans: C and D. because A and B are True
upvoted 20 times
...
AmirhoseinShojaei
Most Recent 2 weeks, 1 day ago
Selected Answer: CD
B and C are correct
upvoted 1 times
...
rodanielb
1 year, 8 months ago
Selected Answer: CD
After executing the snippet: a = a[0] = 1 b = b[0] = 0
upvoted 2 times
...
Ello2023
1 year, 11 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
2 years, 1 month ago
C and D
upvoted 1 times
...
ivanbicalho
2 years, 1 month 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 3 times
...
MherSimonyan
2 years, 2 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
2 years, 4 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, 8 months ago
Correct Answer should be C and D as the question says which equations are False
upvoted 1 times
...
PremJaguar
2 years, 9 months ago
Selected Answer: CD
These answers are wrong, c and d are right
upvoted 1 times
...
macxsz
2 years, 11 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, 12 months ago
Selected Answer: CD
ask about false ones
upvoted 1 times
...
AlMargoi
3 years ago
Selected Answer: CD
Should be C, D.
upvoted 1 times
...
rocky48
3 years, 1 month 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
3 years, 1 month ago
Selected Answer: CD
False are C & D
upvoted 1 times
...
GioGiunta
3 years, 2 months ago
Selected Answer: CD
answer should be C and D, it's asking for False not True
upvoted 1 times
...
diazed
3 years, 3 months ago
Selected Answer: CD
C & D are the correct answers
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago