arjunanand13 commited on
Commit
7b93201
·
verified ·
1 Parent(s): d7160cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -12,7 +12,11 @@ model = genai.GenerativeModel('gemini-pro')
12
 
13
  def get_coding_exercise(topic, difficulty):
14
  """Generate a coding exercise based on the given topic and difficulty."""
15
- prompt = f"Briefly create a {difficulty} Python coding exercise about {topic}. Include a concise problem statement and expected output. Keep it under 100 words."
 
 
 
 
16
  try:
17
  response = model.generate_content(prompt)
18
  return response.text
 
12
 
13
  def get_coding_exercise(topic, difficulty):
14
  """Generate a coding exercise based on the given topic and difficulty."""
15
+
16
+ prompt = f"""Create a {difficulty} Python coding exercise about {topic}.
17
+ Provide ONLY the problem statement and expected output.
18
+ Do NOT include any code or solution.
19
+ Keep it under 100 words and make it clear and concise."""
20
  try:
21
  response = model.generate_content(prompt)
22
  return response.text