Vault of Codes Assignment 2 - 30960551
Vault of Codes Assignment 2 - 30960551
Objective:
The goal of this assignment is to help you understand how different types of prompts can
influence the responses of AI models. You'll practice crafting effective prompts and
analyzing the outcomes.
You will experiment with writing different types of prompts and analyze the variations in
responses to see how prompt structure, length, and wording affect results.
Steps:
1. Choose a Task:
o Select one task you want the AI model to perform. For example:
▪ Summarizing a news article.
▪ Generating a creative story.
▪ Answering a factual question.
▪ Providing advice or solutions to a problem.
2. Design 3 Different Prompts:
o Create three distinct prompts for the same task. Try to vary:
▪ Length (one concise, one medium, and one detailed prompt).
▪ Tone (e.g., formal vs. casual).
▪ Instructions (specific vs. open-ended).
o Example for the task "Generate a creative story":
1. Concise: "Tell me a short story about a robot."
2. Medium: "Write a story about a robot who tries to learn human
emotions."
3. Detailed: "Generate a detailed story about a futuristic robot living in a
world where robots are programmed not to feel, but this robot starts to
develop feelings and has to navigate a world where emotions are
forbidden."
3. Analyze Responses:
o For each prompt, analyze the responses generated by the AI.
▪ How does the length, tone, or clarity of your prompt affect the quality
or style of the response?
▪ Did a more detailed prompt generate a more elaborate response?
▪ Were there any surprises in how the model interpreted your
instructions?
4. Submit:
o Submit the three prompts you designed and the corresponding AI responses.
o Write a brief reflection (150-200 words) on how the changes in your prompt
design influenced the output. Discuss what worked well and what could be
improved.
Bonus (Optional):
• Create a challenging prompt that forces the AI model to think creatively or solve a
difficult problem (e.g., "Generate a mystery story with a plot twist").
Objective:
Build a basic calculator that performs addition, subtraction, multiplication, and division
while handling potential errors like invalid inputs or division by zero. This will help you
practice functions, conditionals, error handling, and user input.
Requirements:
1. Calculator Functions:
o Implement four functions to handle the basic operations:
▪ Addition (add()).
▪ Subtraction (subtract()).
▪ Multiplication (multiply()).
▪ Division (divide()).
2. User Input:
o Ask the user to input:
▪ Two numbers.
▪ The operation they want to perform (+, -, *, /).
3. Error Handling:
o Handle invalid inputs (e.g., if the user inputs a string instead of a number).
o Handle division by zero by displaying an appropriate error message.
4. User Menu:
o Create a simple menu that allows the user to:
▪ Perform a calculation.
▪ Exit the program.
Bonus (Optional):
Instructions:
• Submit your Python file as a .py file.
• Ensure the program gracefully handles errors and gives meaningful feedback to the
user.
Additional Tasks:
Task 1: Advanced Prompt Engineering Techniques
Research and Summarize in a ppt:
Explore advanced prompt engineering techniques such as zero-shot, few-shot, and chain-
of-thought prompting. Describe each technique and its applications.
Hint: Pay special attention to how the amount and type of information provided in each
prompt type affect the AI's performance on the given task.