Skip to content

Instantly share code, notes, and snippets.

@mayuroks
Created May 19, 2014 08:18
Show Gist options
  • Save mayuroks/0cf6d1ba4447a8129ece to your computer and use it in GitHub Desktop.
Save mayuroks/0cf6d1ba4447a8129ece to your computer and use it in GitHub Desktop.
def main():
StNumber, StMark = input('Enter student number and student mark separated by a comma')
StNumber = StNumber.upper()
if len(StNumber)==9 and StNumber[0:6].isalpha() and StNumber[6:].isdigit():
with open("output.txt", "w") as f:
f.write(StNumber + "," + StMark + "\n")
else:
print("Invalid student number")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment