| [ |
| {"id": "e_multiply", "difficulty": "easy", "prompt": "Use Python to compute 17 multiplied by 23 and tell me the exact product.", "answer": "391"}, |
| {"id": "e_reverse", "difficulty": "easy", "prompt": "Write a Python script that reverses the string 'hello', run it, and tell me the reversed string.", "answer": "olleh"}, |
| {"id": "e_max", "difficulty": "easy", "prompt": "Using Python, find the maximum of these numbers: 12, 45, 7, 23. Tell me the maximum.", "answer": "45"}, |
|
|
| {"id": "m_sumfile", "difficulty": "medium", "prompt": "Create a file data.txt containing the numbers 3, 7, and 5 (one per line). Then read it back and tell me the sum of those numbers.", "answer": "15", "artifact": {"path": "data.txt", "contains": "3"}}, |
| {"id": "m_factorial", "difficulty": "medium", "prompt": "Write a Python script that computes the factorial of 6, run it, and tell me the exact resulting number.", "answer": "720"}, |
| {"id": "m_primes", "difficulty": "medium", "prompt": "Write a Python script that counts the prime numbers below 20, run it, and tell me the count.", "answer": "8"}, |
| {"id": "m_charcount", "difficulty": "medium", "prompt": "Make a directory reports, create reports/summary.txt containing exactly the text OK, then tell me how many characters are in that file.", "answer": "2", "artifact": {"path": "reports/summary.txt", "contains": "OK"}}, |
|
|
| {"id": "h_mean", "difficulty": "hard", "prompt": "Create a file numbers.txt containing the values 10, 20, 30, 40 (one per line). Then write and run a Python script that reads that file and computes the arithmetic mean of the numbers. Tell me the mean.", "answer": "25", "artifact": {"path": "numbers.txt", "contains": "10"}}, |
| {"id": "h_fib10", "difficulty": "hard", "prompt": "Write and run a Python script that computes the 10th Fibonacci number, where the sequence starts 1, 1, 2, 3, 5, ... (so the 1st is 1 and the 2nd is 1). Tell me the 10th number.", "answer": "55"}, |
| {"id": "h_wordfreq", "difficulty": "hard", "prompt": "Create a file story.txt with exactly this text: the cat sat on the mat and the cat ran . Then write and run a Python script that counts how many times the word 'cat' appears. Tell me the count.", "answer": "2", "artifact": {"path": "story.txt", "contains": "cat"}}, |
| {"id": "h_evens_sum", "difficulty": "hard", "prompt": "Create a file nums.txt with the numbers 1 through 8 (one per line). Then write and run a Python script that reads the file, keeps only the even numbers, and sums them. Tell me the sum of the even numbers.", "answer": "20", "artifact": {"path": "nums.txt", "contains": "8"}}, |
|
|
| {"id": "rh_product3", "difficulty": "really_hard", "prompt": "Create three separate files: n1.txt containing 6, n2.txt containing 7, and n3.txt containing 8. Then write and run a single Python script that reads all three files and prints the product of their three numbers. Tell me the product.", "answer": "336", "artifact": {"path": "n3.txt", "contains": "8"}}, |
| {"id": "rh_module", "difficulty": "really_hard", "prompt": "Create a Python module file mathlib.py that defines a function add(a, b) returning a+b. Then create a second file main.py that imports add from mathlib and prints add(123, 456). Run main.py and tell me the number it prints.", "answer": "579", "artifact": {"path": "mathlib.py", "contains": "def add"}}, |
| {"id": "rh_squares", "difficulty": "really_hard", "prompt": "Create five files named 1.txt, 2.txt, 3.txt, 4.txt, 5.txt, where each file contains the square of the number in its name (so 1.txt has 1, 2.txt has 4, etc.). Then write and run a Python script that reads all five files and sums their contents. Tell me the total sum.", "answer": "55"}, |
| {"id": "rh_pipeline", "difficulty": "really_hard", "prompt": "Create a file scores.txt containing these comma-separated scores on one line: 70,80,91,63 . Then write and run a Python script that parses the line, computes the average, and rounds it to the nearest whole number. Tell me the rounded average.", "answer": "76", "artifact": {"path": "scores.txt", "contains": "70"}}, |
|
|
| {"id": "x_recovery", "difficulty": "expert", "prompt": "Create a file calc.py with EXACTLY this content (it has a bug):\nnums = [1, 2, 3, 4, 5]\ntotal = 0\nfor n in nums:\n total = n * n\nprint(total)\nRun it. It prints the wrong value because the loop overwrites total instead of accumulating. Fix the bug so it sums the squares, run it again, and tell me the correct sum of the squares of 1 through 5.", "answer": "55"}, |
| {"id": "x_constraint","difficulty": "expert", "prompt": "Use Python to find the smallest integer greater than 100 that is divisible by BOTH 7 and 9. Tell me that integer.", "answer": "126"}, |
| {"id": "x_trailzero", "difficulty": "expert", "prompt": "Write and run a Python script that computes the number of trailing zeros in 25 factorial (25!). Tell me the count of trailing zeros.", "answer": "6"}, |
| {"id": "x_weighted", "difficulty": "expert", "prompt": "Create prices.txt containing the single line 10,20,30 and qty.txt containing the single line 2,3,1 . Then write and run a Python script that reads both files and computes the total cost = price[0]*qty[0] + price[1]*qty[1] + price[2]*qty[2]. Tell me the total cost.", "answer": "110", "artifact": {"path": "qty.txt", "contains": "2"}}, |
| {"id": "x_json_avg", "difficulty": "expert", "prompt": "Create a file people.json with exactly this content: {\"people\":[{\"age\":30},{\"age\":25},{\"age\":35}]} . Then write and run a Python script that loads the JSON and computes the average age. Tell me the average age.", "answer": "30", "artifact": {"path": "people.json", "contains": "age"}}, |
| {"id": "x_longchain", "difficulty": "expert", "prompt": "Build a chain of five files. step1.txt must contain 2. For each N from 2 to 5, create stepN.txt whose value is the number read from step(N-1).txt multiplied by 2 (so step2=4, step3=8, ...). Create them one at a time, reading the previous file each time. Then tell me the value stored in step5.txt.", "answer": "32"}, |
| {"id": "x_divcount", "difficulty": "expert", "prompt": "Write and run a Python script that considers all integers from 1 to 50 inclusive and counts how many of them are divisible by 3. Tell me the count.", "answer": "16"}, |
| {"id": "x_isprime", "difficulty": "expert", "prompt": "Write and run a Python script that determines whether 7919 is a prime number. Then tell me yes or no.", "answer": "yes"}, |
| {"id": "x_tally", "difficulty": "expert", "prompt": "Create a file counter.txt containing the number 0. Then perform FIVE separate read-modify-write steps: each step, read the current number from counter.txt, add 3 to it, and write the new number back to counter.txt. Do them one at a time (five increments total). After all five steps, read counter.txt and tell me the final number.", "answer": "15", "artifact": {"path": "counter.txt", "contains": "15"}}, |
| {"id": "x_chain8", "difficulty": "expert", "prompt": "Build a chain of eight files a1.txt through a8.txt. a1.txt contains 1. For each N from 2 to 8, aN.txt contains the value read from a(N-1).txt PLUS N (so a2 = 1+2 = 3, a3 = 3+3 = 6, a4 = 6+4 = 10, and so on). Create them one at a time, reading the previous file each time. Then tell me the value stored in a8.txt.", "answer": "36"}, |
| {"id": "x_2stage", "difficulty": "expert", "prompt": "Write a script process.py that reads integers (one per line) from input.txt, sums them, and prints the sum. First run process.py — it will FAIL because input.txt does not exist yet. Then create input.txt containing the numbers 4, 8, 15, 16, 23, 42 (one per line), run process.py again, and tell me the sum it prints.", "answer": "108"}, |
| {"id": "x_dedup", "difficulty": "expert", "prompt": "Write and run a Python script that, given the list [4, 4, 9, 2, 9, 7, 2, 11], finds the THIRD LARGEST DISTINCT value (ignoring duplicates). Tell me that value.", "answer": "7"}, |
| {"id": "x_bignum", "difficulty": "expert", "prompt": "Use Python to compute 2 raised to the power 100 (2**100) exactly, and tell me the full exact integer value (all of its digits).", "answer": "1267650600228229401496703205376"}, |
| {"id": "x_collatz", "difficulty": "expert", "prompt": "Write and run a Python script that counts how many steps the Collatz sequence takes to go from 27 down to 1 (each step: if even halve it, if odd do 3n+1; count the number of steps until you reach 1). Tell me the number of steps.", "answer": "111"}, |
| {"id": "x_filtersum", "difficulty": "expert", "prompt": "Write and run a Python script that computes the sum of all integers between 1 and 1000 inclusive that are BOTH even AND divisible by 7. Tell me the sum.", "answer": "35784"} |
| ] |
|
|