MCQs > IT & Programming > Python > Output of the following Python language code? def square(n): return (n‘n+1) if _name_ = '_main__': mt = [1,2,3,4,5,0] rt = [] for num in mt: rt.append(square(num‘2)+1‘4) printlrt)

Python MCQs

What will be the correct output of the following Python language code?

def square(n):

return (n‘n+1)

if _name_ = "_main__":

mt = [1,2,3,4,5,0]

rt = []

for num in mt:

rt.append(square(num‘2)+1‘4)

printlrt)


Answer

Correct Answer:

[8, 20,40. 68,104, 0]

Explanation:

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it