Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- print("Welcome Mr Leeman, to your personal tutor group manager, Please log in (CaSe SeNsItIvE).")
- username ="Mr Leeman"
- password ="TreeRoad" # defining the functions
- UserInput=input("Enter Username: ")#Mr Leeman enters username
- PassInput=input("Enter Password: ")#Mr Leeman enters password
- if not UserInput.strip():
- print("You must not leave any areas blank!")
- if not PassInput.strip():
- print("You must not leave any areas blank!")
- trials = 0
- while (PassInput != password or UserInput != username): #while Mr Leemchoice input for his credentials to not match expected
- if trials==2: # if he takes 3 tries
- exit() # then exit program
- else: # otherwise
- UserInput=input("Your username or password was incorrect: Re-Enter Username ") #if he has tried once or twice
- PassInput=input("Re-Enter Password ")# make him reenter credentials
- trials+=1 # every time he fails an attempt, log it.
- if (PassInput == password and username == UserInput): # if Mr Leemchoice input matches the expected
- print("You have been logged in successfully " + UserInput) # informs Mr Leeman of his login
- time.sleep(1.5)
- menu=True
- while menu:
- print("""
- 1.Enter student details
- 2.View student details
- 3.Search by ID number
- 4.Create reports
- 5.Exit/Quit
- """) # All options for menu
- choice=input("What would you like to do? ") # give Mr Leeman the choice of the 4 actions
- if choice=="1":
- enterstudentdetails()
- elif choice=="2":
- viewallstudentinformation()
- elif choice=="3":
- idsearch()
- elif choice=="4":
- viewreports()
- elif choice=="5":
- exit()
- choice = None
- else:
- print("Choice must be 1,2,3,4 or 5.")
- time.sleep(0.5)
- print("Please try again")
- def enterstudentdetails():
- print("aids")
- #Mr Leeman will enter student details
- #These will be added to the csv file (studentdetails.csv)
- def viewallstudentinformation():
- pass
- #Mr Leeman can input a key which correlates to him being accessed to view all students
- def idsearch():
- pass
- #Mr Leeman can input an ID number (which will be assigned to a student) to display the relevant student's details
- def viewreports():
- pass
- #Mr Leeman can view reports such as:
- #a) list of names of males and email addresses
- #b) list of names of females and specific postcode
- #c) list of all names, birthdays and addresses
- #program initiated here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement