#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
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
5 months, 3 weeks agoseaverick
10 months, 1 week agoEllo2023
1 year, 5 months agoPremi9
1 year, 7 months agoakshay_exam
2 years, 1 month agoN9
2 years, 2 months agomacxsz
2 years, 7 months ago