Consider the following Python function definition and statements: def FUN():…

2026

Consider the following Python function definition and statements:

def FUN():

print("Hello World!")

X = FUN()

print(X)

If the function FUN() does not explicitly return any value using a return statement, what value will be stored in the identifier X?

  1. A.

    True

  2. B.

    NULL

  3. C.

    None

  4. D.

    Raise an error

Attempted by 90 students.

Show answer & explanation

Correct answer: C

In Python, if a function does not explicitly return a value using the 'return' statement, it implicitly returns None. Since FUN() lacks a return statement, calling it assigns None to X.

Explore the full course: Rssb Senior Computer Instructor