In python TASK ONE – Build a function that gets the required information from the user…
- User
In python TASK ONE – Build a function that gets the required information from the user and stores it in your data structure of choice. This includes their: · First name · Middle name · Surname · Gender · Birth day · Birth month · Birth year TASK TWO – Introduce data validation to your TASK ONE function; the user should not be allowed to enter erroneous input, such as blank input or a number instead of a first name. TASK THREE – Build a function that generates characters 1-5 and characters 12-13. TASK FOUR – Build a function that generates characters 6, 7-8, 9-10 and 11. TASK FIVE – Build a function that generates characters 14 and 15-16. TASK SIX – Build a function that assembles the final driver’s license and outputs it for the user. based offf.. Figure 1 Character(s) Requirement 1-5 First five characters of the driver’s surname. If the surname is shorter than 5 characters long, any leftover characters are filled up with 9s (e.g, LEE99). 6 The decade digit from the driver’s birth year (e.g, 7 in 1973). 7-8 The driver’s birth month, 01-12. For female drivers only, the seventh character is incremented by 5, 51-62. 9-10 The driver’s birth day, 01-31. If the birth month is February, this range is 01-28, and if the birth year is a leap year, it is 01-29. 11 The year digit from the driver’s birth year (e.g, 3 in 1973). 12-13 The first character from the driver’s first name and the first character from the driver’s middle name. If the driver has no middle name, the character is replaced with a 9. 14 A random digit, typically 9. This is to avoid having drivers with duplicate details. If a new driver with the same details applies, this digit is reduced by 1 and 9 becomes 8, 8 becomes 7 and so on. You can assume there will be no duplicate drivers. 15-16 Two random letters A-Z.
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.