#question 24
def a (l, I):
return l [I]
print (a(0, [1))
#SyntaxError: closing parenthesis ')' does not match opening parenthesis '['
Tested: A (cause a runtime exception)
A.
Here is another example to give you a gist of what it should have been if it was coded correctly
def a (I, L):
return l [L]
my = [1, 2, 3, 4]
print (a(my, 3))
#Answer 4
L now picks the index number 3 in my which is I
A. Caused run time exception
even if the syntax is correct it would throw error as positional arguments is not in correct position
if calling function is a([1],0) instead of a(0,[1]) then it gives output as 1
This section is not available anymore. Please use the main Exam Page.PCAP Exam Questions
Log in to ExamTopics
Sign in:
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.
Damon54
10 months, 3 weeks agoseaverick
1 year, 3 months agoEllo2023
1 year, 10 months agoPremi9
2 years agoakshay_exam
2 years, 6 months agoN9
2 years, 7 months agomacxsz
2 years, 11 months ago