Past questions › fam-q9b
2025 3 marks Python / code Secure Software Architecture (Year 12) Developing secure code (Python input validation)
NESA 2025 HSC Software Engineering Familiarisation Questions - Marking Guidelines (official, 12 June 2025)
[Question stem not available as text (it is on the interactive NESA familiarisation site). Task per the NESA mapping grid: a Python function that checks whether a username satisfies given rules (stem not available)]
Marking criteria
3: Correct function in Python that checks whether a username satisfies the rules. 2: Partially correct function. 1: Some understanding of the problem and Python.
Sample answer
def validateUsername(username):
# Length check
if len(username) > 8:
return False
# Alpha character only check
elif username.isalpha() == False:
return False
# < character check
elif "<" in username:
return False
# If we reach here then the username meets the requirements
return True