Exam Certified Data Engineer Associate All QuestionsBrowse all questions from this exam
Question 106

A data engineer that is new to using Python needs to create a Python function to add two integers together and return the sum?

Which code block can the data engineer use to complete this task?

    Correct Answer: D

    In Python, to define a function you use the 'def' keyword followed by the function name and parameters in parentheses. To add two integers and return the result, the function must include a 'return' statement that returns the sum of the parameters. The correct code block is 'def add_integers(x, y): return x + y', which meets these requirements.

Discussion
helmerpaivaOption: D

Correct is D

nawfalbourassOption: D

RETURN is needed

Ivan_PetrovOption: D

Correct answer is D

3fbc31bOption: D

For the function to perform the actions "RETURN" must be present.

hussamAlHunaitiOption: D

Answer is D.

PreranaCOption: D

D, RETURN in Python needed

KunkaOption: D

Answer is D. C is wrong answer, as it missed return key workd

jetplanesOption: D

The correct answer is D because the python function needs to provide a return for the function, so C is incorrect.