step1 is referenced without parentheses, so it is not called.
Step 2: Confirm other parts
step2() is called correctly; function definitions and print statements are correct.
Final Answer:
Missing parentheses when calling step1 -> Option D
Quick Check:
Function calls need parentheses [OK]
Hint: Always use () to call functions [OK]
Common Mistakes:
Forgetting parentheses on function calls
Thinking print statements cause errors
Assuming function definitions are wrong
5. You want to build an AI agent that processes data in three steps: load data, clean data, and analyze data. Which sequence of function calls correctly follows sequential step execution?
hard
A. load_data()
clean_data()
analyze_data()
B. analyze_data(clean_data(load_data()))
C. clean_data(load_data())
analyze_data()
D. load_data()
analyze_data()
clean_data()
Solution
Step 1: Understand the data flow
Data must be loaded first, then cleaned, then analyzed in order.
Step 2: Check function call order
Calling load_data(), then clean_data(), then analyze_data() in sequence preserves the correct order and clarity.
Final Answer:
load_data()
clean_data()
analyze_data() -> Option A
Quick Check:
Sequential calls preserve step order clearly [OK]
Hint: Call functions in order to keep correct step sequence [OK]