The Ministry of Home Affairs and Immigration would like to introduce an automated id number and passport generation system. The system takes into consideration the following:
Your task is to create a program that can achieve the above requirements to assist the ministry automate it’s operations
Input
Input is a single line with the person's first name, date of birth(format YYYY-MM-DD) and five-digit postfix through keyboard input, all separated by single spaces
import datetime
name=input("Enter your first name: ")
number=int(input("Enter the five-digit post fix number: "))
year=int(input("Enter the year: "))
month=int(input("Enter the month: "))
day=int(input("Enter the month: "))
string = str(number)
length = len(string)
c = int(string[length - 2: length])
stri = str(year)
leng = len(stri)
x = int(stri[leng - 2: leng])
print("Id number is: ",end="")
print(x,end="")
print(month,end="")
print(day,end="")
print(number)
print("Passport is: ",end="")
print(month,end="")
print(day,end="")
print("P-NAM",end="")
print(c)
Comments
Leave a comment