Get startedGet started for free

Chain-of-thought to discover reasoning

You're presented with a common math problem to determine the number of fruits in a basket. You want ChatGPT to solve this problem to you, while providing a step by step reasoning.

The get_response() function to communicate with ChatGPT is pre-loaded for you.

This exercise is part of the course

Explainable AI in Python

View Course

Exercise instructions

  • Complete the prompt to get a chain-of-thought reasoning for this problem.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Complete the chain-of-thought prompt
prompt = "In a basket, there are twice as many apples as oranges and three times as many oranges as bananas. If there are 6 bananas in the basket, how many fruits are there in total? ____"

response = get_response(prompt)
print(response)
Edit and Run Code