0
0
AI for Everyoneknowledge~15 mins

Providing context and constraints in AI for Everyone - Mini Project: Build & Apply

Choose your learning style9 modes available
Providing Context and Constraints
📖 Scenario: You are helping a friend understand how giving clear context and constraints helps AI systems give better answers. Imagine you want to ask an AI assistant to help plan a birthday party.
🎯 Goal: Build a simple step-by-step example showing how adding context and constraints changes the quality of AI responses.
📋 What You'll Learn
Create a variable called basic_request with the text of a simple question to an AI.
Create a variable called context that adds background information about the party.
Create a variable called constraints that lists limits like budget or number of guests.
Combine basic_request, context, and constraints into a final full_prompt string.
💡 Why This Matters
🌍 Real World
When talking to AI assistants, giving clear background and limits helps get useful answers.
💼 Career
Many jobs use AI tools; knowing how to provide good context and constraints improves communication and results.
Progress0 / 4 steps
1
Create the basic AI request
Create a variable called basic_request and set it to the string "Plan a birthday party."
AI for Everyone
Hint

Use quotes to create a string and assign it to basic_request.

2
Add context about the party
Create a variable called context and set it to the string "The party is for a 10-year-old who loves superheroes."
AI for Everyone
Hint

Remember to use quotes and assign the string exactly as shown.

3
Add constraints for the party plan
Create a variable called constraints and set it to the string "Budget is $100 and there will be 15 guests."
AI for Everyone
Hint

Use the exact string including the dollar sign and numbers.

4
Combine all parts into a full prompt
Create a variable called full_prompt that combines basic_request, context, and constraints into one string separated by spaces.
AI for Everyone
Hint

Use the + operator to join strings with spaces in between.