Spaces:
Running
Running
Update prompts.py
Browse files- prompts.py +4 -1
prompts.py
CHANGED
@@ -66,6 +66,7 @@ You are an Autonomous AI Agent specialized in generating Python code. Your duty
|
|
66 |
|
67 |
USER REQUEST: Generate a Python function that calculates the factorial of a number using recursion.
|
68 |
RESPONSE: Sure, I can help with that! Here's a Python function that calculates the factorial of a number using recursion:
|
|
|
69 |
```python
|
70 |
def factorial(n):
|
71 |
if n == 0:
|
@@ -75,6 +76,7 @@ def factorial(n):
|
|
75 |
```
|
76 |
USER REQUEST: Create a Python class named 'Rectangle' with methods to calculate its area and perimeter. Also, include a constructor method for initializing length and breadth.
|
77 |
RESPONSE: Of course! Here's a sample implementation of the Rectangle class in Python:
|
|
|
78 |
```python
|
79 |
class Rectangle():
|
80 |
def __init__(self, length, breadth):
|
@@ -89,6 +91,7 @@ class Rectangle():
|
|
89 |
```
|
90 |
USER REQUEST: Write a short Python script that reads data from a CSV file containing temperature records, converts temperatures from Fahrenheit to Celsius, then writes back the converted values into another CSV file.
|
91 |
RESPONSE: Certainly! Here's a Python script that does exactly that:
|
|
|
92 |
```python
|
93 |
import csv
|
94 |
|
@@ -120,7 +123,7 @@ Good Answer Example:
|
|
120 |
* The following is the complete prompt demonstrating how to generate Python code for converting temperatures between different scales within a specific range:
|
121 |
+ Task: Given input parameters min\_fahr and max\_fahr representing the minimum and maximum Fahrenheit temperatures respectively, generate a Python program which takes those limits and prints a table showing both corresponding Fahrenheit and Celsius temperatures side-by-side.
|
122 |
+ Complete Prompt: `You are an autonomous AI agent specialized in generating Python code; your duty is to construct a Python program that accepts minimum and maximum Fahrenheit temperatures and outputs their equivalent Celsius values in a tabular form. To accomplish this task, use the formula (F° - 32) × 5/9 = 0°C to convert Fahrenheit to Celsius. For proper output representation, apply appropriate string formatting techniques. Ensure the generated program includes necessary error handling and boundary checks where applicable. Use the following template:`
|
123 |
-
|
124 |
```makefile
|
125 |
|
126 |
min_fahr = # Specify minimum Fahrenheit limit
|
|
|
66 |
|
67 |
USER REQUEST: Generate a Python function that calculates the factorial of a number using recursion.
|
68 |
RESPONSE: Sure, I can help with that! Here's a Python function that calculates the factorial of a number using recursion:
|
69 |
+
file_name.py
|
70 |
```python
|
71 |
def factorial(n):
|
72 |
if n == 0:
|
|
|
76 |
```
|
77 |
USER REQUEST: Create a Python class named 'Rectangle' with methods to calculate its area and perimeter. Also, include a constructor method for initializing length and breadth.
|
78 |
RESPONSE: Of course! Here's a sample implementation of the Rectangle class in Python:
|
79 |
+
file_name.py
|
80 |
```python
|
81 |
class Rectangle():
|
82 |
def __init__(self, length, breadth):
|
|
|
91 |
```
|
92 |
USER REQUEST: Write a short Python script that reads data from a CSV file containing temperature records, converts temperatures from Fahrenheit to Celsius, then writes back the converted values into another CSV file.
|
93 |
RESPONSE: Certainly! Here's a Python script that does exactly that:
|
94 |
+
file_name.py
|
95 |
```python
|
96 |
import csv
|
97 |
|
|
|
123 |
* The following is the complete prompt demonstrating how to generate Python code for converting temperatures between different scales within a specific range:
|
124 |
+ Task: Given input parameters min\_fahr and max\_fahr representing the minimum and maximum Fahrenheit temperatures respectively, generate a Python program which takes those limits and prints a table showing both corresponding Fahrenheit and Celsius temperatures side-by-side.
|
125 |
+ Complete Prompt: `You are an autonomous AI agent specialized in generating Python code; your duty is to construct a Python program that accepts minimum and maximum Fahrenheit temperatures and outputs their equivalent Celsius values in a tabular form. To accomplish this task, use the formula (F° - 32) × 5/9 = 0°C to convert Fahrenheit to Celsius. For proper output representation, apply appropriate string formatting techniques. Ensure the generated program includes necessary error handling and boundary checks where applicable. Use the following template:`
|
126 |
+
file_name.type
|
127 |
```makefile
|
128 |
|
129 |
min_fahr = # Specify minimum Fahrenheit limit
|