English
Tasks
Complete the task of the chosen difficulty level for your variant number.
Use Python 3.14; all functions must have annotations. Document file formats, encoding, the CSV delimiter, fields, and units in the README. An input-data error must not silently produce a plausible incomplete result. Tests perform file changes only in tmp_path.
Variants
Variant 1. Expense tracking
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: category,date,cents. Validate: an ISO date, a nonempty category, and a positive integer amount in kopiykas. Calculate and output total kopiykas by category. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: category,date,cents. Validate: an ISO date, a nonempty category, and a positive integer amount in kopiykas. Calculate and output total kopiykas by category. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: category,date,cents. Validate: an ISO date, a nonempty category, and a positive integer amount in kopiykas. Calculate and output total kopiykas by category. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 2. Gym
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: name,until. Validate: a nonempty name and an ISO expiration date. Calculate and output names of those whose memberships have expired as of an ISO date passed as an argument. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: name,until. Validate: a nonempty name and an ISO expiration date. Calculate and output names of those whose memberships have expired as of an ISO date passed as an argument. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: name,until. Validate: a nonempty name and an ISO expiration date. Calculate and output names of those whose memberships have expired as of an ISO date passed as an argument. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 3. Photo archive
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: path,bytes. Validate: a relative JPG or PNG path and a nonnegative integer size. Calculate and output counts and bytes by extension; generate input by traversing the supplied folder without changing images. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: path,bytes. Validate: a relative JPG or PNG path and a nonnegative integer size. Calculate and output counts and bytes by extension; generate input by traversing the supplied folder without changing images. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: path,bytes. Validate: a relative JPG or PNG path and a nonnegative integer size. Calculate and output counts and bytes by extension; generate input by traversing the supplied folder without changing images. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 4. Plant watering
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: plant,last,days. Validate: a nonempty name, an ISO date, and an integer interval of 1..30. Calculate and output the next watering date as last plus days days. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: plant,last,days. Validate: a nonempty name, an ISO date, and an integer interval of 1..30. Calculate and output the next watering date as last plus days days. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: plant,last,days. Validate: a nonempty name, an ISO date, and an integer interval of 1..30. Calculate and output the next watering date as last plus days days. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 5. Company fleet
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: car,km,last_service. Validate: a vehicle code and nonnegative integer readings, with km no less than last_service. Calculate and output vehicles that have traveled at least 10000 km since their last service. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: car,km,last_service. Validate: a vehicle code and nonnegative integer readings, with km no less than last_service. Calculate and output vehicles that have traveled at least 10000 km since their last service. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: car,km,last_service. Validate: a vehicle code and nonnegative integer readings, with km no less than last_service. Calculate and output vehicles that have traveled at least 10000 km since their last service. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 6. Gradebook
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: student,score. Validate: a nonempty name and an integer score of 0..100. Calculate and output each student's average score, sorted by descending score and then name. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: student,score. Validate: a nonempty name and an integer score of 0..100. Calculate and output each student's average score, sorted by descending score and then name. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: student,score. Validate: a nonempty name and an integer score of 0..100. Calculate and output each student's average score, sorted by descending score and then name. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 7. Recipe collection
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: dish,ingredient,grams. Validate: nonempty names and a positive integer mass. Calculate and output dishes containing the ingredient passed as an argument. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: dish,ingredient,grams. Validate: nonempty names and a positive integer mass. Calculate and output dishes containing the ingredient passed as an argument. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: dish,ingredient,grams. Validate: nonempty names and a positive integer mass. Calculate and output dishes containing the ingredient passed as an argument. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 8. CSV and JSON converter
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: name,quantity. Validate: a nonempty name and a nonnegative integer quantity. Calculate and output an equivalent file in the other format, preserving the numeric type of quantity. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: name,quantity. Validate: a nonempty name and a nonnegative integer quantity. Calculate and output an equivalent file in the other format, preserving the numeric type of quantity. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: name,quantity. Validate: a nonempty name and a nonnegative integer quantity. Calculate and output an equivalent file in the other format, preserving the numeric type of quantity. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 9. Movie library
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: title,year,rating. Validate: a title, a year of 1888..2100, and a finite rating of 0..10. Calculate and output movies from the year given as an argument, in descending rating order. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: title,year,rating. Validate: a title, a year of 1888..2100, and a finite rating of 0..10. Calculate and output movies from the year given as an argument, in descending rating order. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: title,year,rating. Validate: a title, a year of 1888..2100, and a finite rating of 0..10. Calculate and output movies from the year given as an argument, in descending rating order. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 10. Station weather data
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: station,date,temp. Validate: a station code, an ISO date, and a finite temperature of -100..100. Calculate and output average temperature by station across all input files of the selected format in the supplied folder. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: station,date,temp. Validate: a station code, an ISO date, and a finite temperature of -100..100. Calculate and output average temperature by station across all input files of the selected format in the supplied folder. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: station,date,temp. Validate: a station code, an ISO date, and a finite temperature of -100..100. Calculate and output average temperature by station across all input files of the selected format in the supplied folder. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 11. Office inventory
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: code,expected,actual. Validate: a unique code and nonnegative integer quantities. Calculate and output positive shortages as expected minus actual. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: code,expected,actual. Validate: a unique code and nonnegative integer quantities. Calculate and output positive shortages as expected minus actual. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: code,expected,actual. Validate: a unique code and nonnegative integer quantities. Calculate and output positive shortages as expected minus actual. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 12. Backup
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: source,target. Validate: two different folders, with the target outside the source. Calculate and output copies of regular source files in the target and a JSON log of relative paths; skip links and delete nothing. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: source,target. Validate: two different folders, with the target outside the source. Calculate and output copies of regular source files in the target and a JSON log of relative paths; skip links and delete nothing. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: source,target. Validate: two different folders, with the target outside the source. Calculate and output copies of regular source files in the target and a JSON log of relative paths; skip links and delete nothing. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 13. Tournament standings
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: team,win,draw,loss. Validate: a name and nonnegative integer counts. Calculate and output points 3*win+draw and standings by descending points, then name. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: team,win,draw,loss. Validate: a name and nonnegative integer counts. Calculate and output points 3*win+draw and standings by descending points, then name. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: team,win,draw,loss. Validate: a name and nonnegative integer counts. Calculate and output points 3*win+draw and standings by descending points, then name. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 14. Glossary
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: term,definition. Validate: nonempty terms and definitions, with case-insensitively unique terms. Calculate and output terms containing the substring passed as an argument, ignoring case. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: term,definition. Validate: nonempty terms and definitions, with case-insensitively unique terms. Calculate and output terms containing the substring passed as an argument, ignoring case. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: term,definition. Validate: nonempty terms and definitions, with case-insensitively unique terms. Calculate and output terms containing the substring passed as an argument, ignoring case. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 15. Habit tracker
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: habit,date. Validate: a nonempty name and an ISO date, with duplicate pairs prohibited. Calculate and output the longest sequence of calendar days for each habit. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: habit,date. Validate: a nonempty name and an ISO date, with duplicate pairs prohibited. Calculate and output the longest sequence of calendar days for each habit. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: habit,date. Validate: a nonempty name and an ISO date, with duplicate pairs prohibited. Calculate and output the longest sequence of calendar days for each habit. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 16. Doctor appointments
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: doctor,date,time. Validate: a fictional name, an ISO date, and a time HH:MM; no medical recommendations. Calculate and output conflicts with the same doctor, date, and time; do not include patients' personal data. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: doctor,date,time. Validate: a fictional name, an ISO date, and a time HH:MM; no medical recommendations. Calculate and output conflicts with the same doctor, date, and time; do not include patients' personal data. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: doctor,date,time. Validate: a fictional name, an ISO date, and a time HH:MM; no medical recommendations. Calculate and output conflicts with the same doctor, date, and time; do not include patients' personal data. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 17. Duplicate files
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: folder. Validate: an existing readable directory; skip links. Calculate and output groups of regular files with identical SHA-256 hashes and relative paths, without deleting any files. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: folder. Validate: an existing readable directory; skip links. Calculate and output groups of regular files with identical SHA-256 hashes and relative paths, without deleting any files. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: folder. Validate: an existing readable directory; skip links. Calculate and output groups of regular files with identical SHA-256 hashes and relative paths, without deleting any files. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 18. Classroom schedule
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: room,date,start,end. Validate: a classroom, an ISO date, minutes of 0..1440, and start<end. Calculate and output pairs of overlapping half-open intervals for the same classroom and date. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: room,date,start,end. Validate: a classroom, an ISO date, minutes of 0..1440, and start<end. Calculate and output pairs of overlapping half-open intervals for the same classroom and date. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: room,date,start,end. Validate: a classroom, an ISO date, minutes of 0..1440, and start<end. Calculate and output pairs of overlapping half-open intervals for the same classroom and date. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 19. Movie theater box office
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: session,ticket,cents. Validate: a screening code, a unique ticket, and a positive integer amount in kopiykas. Calculate and output the number of tickets sold and revenue for each screening. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: session,ticket,cents. Validate: a screening code, a unique ticket, and a positive integer amount in kopiykas. Calculate and output the number of tickets sold and revenue for each screening. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: session,ticket,cents. Validate: a screening code, a unique ticket, and a positive integer amount in kopiykas. Calculate and output the number of tickets sold and revenue for each screening. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 20. Address book
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: name,email. Validate: a nonempty name and an email containing one @ character and nonempty parts. Calculate and output groups of duplicate emails, ignoring case; do not delete them automatically. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: name,email. Validate: a nonempty name and an email containing one @ character and nonempty parts. Calculate and output groups of duplicate emails, ignoring case; do not delete them automatically. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: name,email. Validate: a nonempty name and an email containing one @ character and nonempty parts. Calculate and output groups of duplicate emails, ignoring case; do not delete them automatically. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 21. Energy meters
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: meter,date,kwh. Validate: a code, an ISO date, and a nonnegative integer cumulative reading. Calculate and output the difference between the last and first readings for each meter and month; reject decreasing readings. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: meter,date,kwh. Validate: a code, an ISO date, and a nonnegative integer cumulative reading. Calculate and output the difference between the last and first readings for each meter and month; reject decreasing readings. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: meter,date,kwh. Validate: a code, an ISO date, and a nonnegative integer cumulative reading. Calculate and output the difference between the last and first readings for each meter and month; reject decreasing readings. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 22. Warehouse records
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: product,delta. Validate: a name and a signed integer quantity change, with an initial balance of zero. Calculate and output current stock balances by applying rows in sequence; reject a negative balance. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: product,delta. Validate: a name and a signed integer quantity change, with an initial balance of zero. Calculate and output current stock balances by applying rows in sequence; reject a negative balance. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: product,delta. Validate: a name and a signed integer quantity change, with an initial balance of zero. Calculate and output current stock balances by applying rows in sequence; reject a negative balance. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 23. Download organizer
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: source,target. Validate: different folders, with the target outside the source. Calculate and output copies of files in subfolders by extension and a JSON log; do not move files, and reject name conflicts. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: source,target. Validate: different folders, with the target outside the source. Calculate and output copies of files in subfolders by extension and a JSON log; do not move files, and reject name conflicts. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: source,target. Validate: different folders, with the target outside the source. Calculate and output copies of files in subfolders by extension and a JSON log; do not move files, and reject name conflicts. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 24. Running log
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: date,meters,seconds. Validate: an ISO date and positive integer meters and seconds. Calculate and output the fastest average speed meters/seconds and total distance. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: date,meters,seconds. Validate: an ISO date and positive integer meters and seconds. Calculate and output the fastest average speed meters/seconds and total distance. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: date,meters,seconds. Validate: an ISO date and positive integer meters and seconds. Calculate and output the fastest average speed meters/seconds and total distance. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 25. Family budget
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: category,kind,cents. Validate: a category, kind of income or expense, and a positive amount in kopiykas. Calculate and output income, expenses, and their difference by category. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: category,kind,cents. Validate: a category, kind of income or expense, and a positive amount in kopiykas. Calculate and output income, expenses, and their difference by category. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: category,kind,cents. Validate: a category, kind of income or expense, and a positive amount in kopiykas. Calculate and output income, expenses, and their difference by category. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 26. Exam tickets
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: id,text. Validate: a unique integer id and nonempty text. Calculate and output three tickets with two different questions each and no repetition across tickets; require at least six questions and pass seed as an argument. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: id,text. Validate: a unique integer id and nonempty text. Calculate and output three tickets with two different questions each and no repetition across tickets; require at least six questions and pass seed as an argument. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: id,text. Validate: a unique integer id and nonempty text. Calculate and output three tickets with two different questions each and no repetition across tickets; require at least six questions and pass seed as an argument. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 27. Log analyzer
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: level,message. Validate: a level of INFO, WARNING, or ERROR and message text. Calculate and output record counts by level and a separate list of ERROR entries. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: level,message. Validate: a level of INFO, WARNING, or ERROR and message text. Calculate and output record counts by level and a separate list of ERROR entries. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: level,message. Validate: a level of INFO, WARNING, or ERROR and message text. Calculate and output record counts by level and a separate list of ERROR entries. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 28. Car rental
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: car,start,end. Validate: a code, ISO dates, and start<end. Calculate and output pairs of conflicting bookings for the same car using half-open intervals. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: car,start,end. Validate: a code, ISO dates, and start<end. Calculate and output pairs of conflicting bookings for the same car using half-open intervals. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: car,start,end. Validate: a code, ISO dates, and start<end. Calculate and output pairs of conflicting bookings for the same car using half-open intervals. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 29. Survey
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: question,answer. Validate: a question code and an answer of A, B, or C. Calculate and output answer counts and percentages for each question, avoiding division by zero for an empty group. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: question,answer. Validate: a question code and an answer of A, B, or C. Calculate and output answer counts and percentages for each question, avoiding division by zero for an empty group. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: question,answer. Validate: a question code and an answer of A, B, or C. Calculate and output answer counts and percentages for each question, avoiding division by zero for an empty group. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Variant 30. Cafeteria menu
1. Initial level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: day,dish,kcal. Validate: a day of 1..7, a name, and a nonnegative integer sample calorie count. Calculate and output total calories by day; the figures are for learning purposes, not dietary recommendations. For tabular data, read UTF-8 CSV with ; as the delimiter; for folders, perform the traversal described. Provide two pytest tests of the calculation.
2. Basic level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: day,dish,kcal. Validate: a day of 1..7, a name, and a nonnegative integer sample calorie count. Calculate and output total calories by day; the figures are for learning purposes, not dietary recommendations. Organize the code into a package with a -m entry point and argparse. For tabular data, read a JSON array of objects; file tasks accept paths. Save the result as JSON at a separate path. Add pytest tests for success, empty data, and an error.
3. Advanced level. Create a console program with annotated functions. Pass input as a path on the command line; fields or parameters: day,dish,kcal. Validate: a day of 1..7, a name, and a nonnegative integer sample calorie count. Calculate and output total calories by day; the figures are for learning purposes, not dietary recommendations. Organize a package with argparse and --help; select CSV or JSON tabular input with an option. Save the result as JSON and CSV; for complex groups, CSV contains one row per element. Validate all input before writing, and preserve the old output if the data is invalid. Pytest tests with tmp_path, parameterization, and raises are required; include at least five cases.
Procedure
- Define the package structure, each function's contract, and the file schema with examples of valid and invalid records.
- Implement pure calculations separately from reading, writing, and the CLI. Use explicit encoding and
withfor resources. - Add pytest tests for normal, empty, boundary, and invalid data. Use
tmp_pathfor file scenarios. - Check the exact result, types after restoration, and preservation of the old output when input data is invalid.
- Run the same suite from the terminal and PyCharm; explain a parameterized case and the message from a deliberately broken test.
- Submit a local Git repository with code, a README, sample data, and dependencies; exclude the environment and caches. GitHub is optional. During the defense, demonstrate running with
-mand--help.