Skip to content
free
K
1
2
practice
Home
Math
English
Science
Social Studies
Contact
Language
English
Español
Sign In
/
High School Electives
/
Computer Science
/
Coding Conventions and Style Guides
Grade Level
Computer Science
HSCS.172 Coding Conventions and Style Guides
0%
Skill Level
🔴 Hard
00:00
Progress to Next Level
25% to Medium
Easy
Medium
Hard
Mastery
100%
A class has a method `processData` that validates grades, calculates averages, and writes a file. The Python style guide favors snake_case and single-purpose functions. Which revision best follows it?
A
Move the whole method into the constructor
B
Rename the method to `process_data` but keep every responsibility inside it
C
Create `validate_grades`, `calculate_average_grade`, and `write_grade_report` helper functions
D
Rename it to `pd` and add comments for each block
Submit Answer