Student Record Formatter
Python
30 pts
Student Record Formatter
Clean up a student record using string methods:
name—raw_namewith spaces removed from both ends and every word capitalised withtitle()number—raw_numberpadded with zeros to 5 digits usingzfill()valid—Trueifraw_numbercontains only digits (useisdigit())header— the word"REPORT"centred in 20 characters, filled with"*"
Print header, name, number and valid, one per line. Expected output:
*******REPORT******* Merhawi Tesfay 00042 True
Checklist
- Keep the raw values unchanged and create
name: stripped, with every word capitalised. - Create
number:raw_numberpadded with zeros to 5 digits. - Create
valid: whetherraw_numbercontains only digits. - Create
header:"REPORT"centred in 20 characters, filled with"*". - Print
header,name,numberandvalid, one per line.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
