SE Bang!¶

Setup¶
- Each player secretly draws one role card.
- Your role defines your hidden goal — keep it secret until the end (you will be punished if you revealed it too early).
Goal¶
Work together to improve a small Python function the tutor show to you. Everyone edits the same code, you should work together on the same file on the same computer.
Silence Rule¶
- You must not reveal or hint at your role.
- Base your arguments only on reasoning about the code.
- Keep the discussion respectful and focused.
Time¶
You have 5 minutes to discuss and edit the code together.
Reveal¶
When the tutor asks, everyone reveals their role. Check which goals were met and who managed to stay hidden.
Scoring¶
- +1 point for each goal successfully met (over 50% of objectives achieved).
- 0 points for unmet goals.
- −1 point for each role correctly identified before the reveal.
Debrief¶
Reflect briefly:
- Which goals aligned or conflicted?
- How did hidden intentions shape the teamwork?
- What helped or hindered collaboration?
Code snippets to work on¶
1: Factorial
A simple recursive function to compute the factorial of a non‑negative integer. It lacks input validation and does not handle negative values gracefully.
1 2 3 4 | |
2: Average
Calculates the average of numeric values in a list by summing and dividing by the count. It does not handle empty lists or mixed types properly, and it may produce integer division depending on the Python version.
1 2 3 4 5 | |
3: Parse Date
Splits a date string formatted as "YYYY-MM-DD" into integers for year, month, and day. It assumes the input is valid, without checking ranges or supporting other separators.
1 2 3 4 5 6 | |
4: nth Prime
Finds the nth prime number by iterating through candidates and testing divisibility. It is inefficient and does not check for non-positive inputs or optimize prime detection.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
5: Celsius to Fahrenheit
Converts a Celsius temperature to Fahrenheit using the standard formula. It lacks input validation and does not provide rounding or handle lists of temperatures.
1 2 | |
6: Sort Strings
Sorts a list of strings alphabetically using a nested loop swap. It compares strings case‑sensitively and mutates the input list directly.
1 2 3 4 5 6 7 8 | |
7: Count Words
Counts the number of non‑empty substrings in a string separated by spaces. It treats punctuation as part of words and does not handle other whitespace or edge cases.
1 2 3 | |
8: Max Value
Returns the largest value in a list by iterating and updating a maximum variable starting at zero. It fails for lists containing only negative numbers or when the list is empty.
1 2 3 4 5 6 | |
9: Fibonacci
Recursively calculates the nth Fibonacci number. The base cases cover n <= 1, but the function does not validate input or handle negative values, and its recursion is inefficient.
1 2 3 4 | |
10: Palindrome
Checks if a string reads the same forwards and backwards using slicing. It is case‑sensitive and includes all characters, ignoring spacing or punctuation.
1 2 | |
11: Area
Computes the area of a rectangle given length and width when the shape parameter is "rectangle". For any other shape, it returns None without error handling.
1 2 3 4 5 | |
12: Remove Duplicates
Creates a new list by iterating through the original list and appending items not already present. It uses nested loops and does not preserve order efficiently for large lists.
1 2 3 4 5 6 7 8 9 10 11 | |
13: Dict to JSON
Manually concatenates a dictionary into a JSON‑like string with key–value pairs separated by commas. It does not handle strings appropriately and cannot serialize nested structures.
1 2 3 4 5 | |
14: BMI
Calculates Body Mass Index (BMI) from weight in kilograms and height in centimeters. The default height is fixed, and the function does not check for invalid or missing inputs.
1 2 3 | |
15: Read File
Opens a file, reads its entire content, prints it, and returns it. It does not close the file or handle exceptions for missing or large files.
1 2 3 4 5 | |