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

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 of the following code blocks can the data engineer use to complete this task?

    Correct Answer: D

    To create a Python function to add two integers and return the sum, you need to use the 'def' keyword to define the function. Inside the function, you use the 'return' statement to return the result of adding the two integers. The code block in option D correctly defines a function named 'add_integers', takes two parameters 'x' and 'y', adds them, and returns the result.

Discussion
55f31c8Option: D

D : https://www.geeksforgeeks.org/python-functions/

meow_akkOption: D

D is correct. if you get this answer wrong you need to learn the basics of python.

kz_dataOption: D

D is correct

SydOption: D

D is correct. https://www.w3schools.com/python/python_functions.asp

UGOTCOOKIESOption: D

Python functions start with the def keyword followed by the function name. Function also ends with the return keyword.

azure_bimonsterOption: D

D is to choose here