Changeset 11548 for main/pyfprint
- Timestamp:
- 27 Mar 2014, 13:56:28 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/pyfprint/trunk/enroll-script.py
r11547 r11548 32 32 """Get a student id via input from keyboard. 33 33 34 We require the id two times (for safety). The id must not be 35 empty. 34 We require the id two times (for safety). The id must have length 8. 36 35 """ 37 36 while True: 38 37 stud_id = raw_input("Please ENTER the STUDENT ID: ") 39 ctrl_id = raw_input("Please repeat : ") 40 if not stud_id: 38 if len(stud_id) != 8: 41 39 print "Please enter a valid student ID!" 42 stud_id = None 43 if stud_id != ctrl_id: 44 print "IDs do not match. We restart." 45 if stud_id and stud_id == ctrl_id: 46 return stud_id 40 else: 41 ctrl_id = raw_input("Please repeat : ") 42 if stud_id != ctrl_id: 43 print "IDs do not match. We restart." 44 else: 45 return stud_id 47 46 48 47
Note: See TracChangeset for help on using the changeset viewer.