Bird
0
0

Given this function code deployed with HTTP trigger:

medium📝 Predict Output Q4 of 15
GCP - Cloud Functions
Given this function code deployed with HTTP trigger:
def hello_world(request):
    return 'Hello, Cloud!'

What will be the HTTP response body when the function is called?
A"Hello, Cloud!"
BError: Missing return statement
CEmpty response
D"hello_world"
Step-by-Step Solution
Solution:
  1. Step 1: Analyze function return value

    The function returns the string 'Hello, Cloud!' when called.
  2. Step 2: Understand HTTP response

    Since the function returns this string, the HTTP response body will contain exactly that string.
  3. Final Answer:

    "Hello, Cloud!" -> Option A
  4. Quick Check:

    Function return = HTTP response body [OK]
Quick Trick: Function return string becomes HTTP response body [OK]
Common Mistakes:
  • Expecting function name as response
  • Thinking empty response
  • Assuming error without cause

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes