Advertisement
Karlo43210

Untitled

Jul 1st, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 18.26 KB | None | 0 0
  1. numberoftries = 3
  2. print("Hello Mr Lee!")
  3. while numberoftries > 0:
  4.     print("You have", (numberoftries), "tries remaining")
  5.     username =(input("Enter the username"))
  6.     password = (input("Enter the password"))
  7.     if (password) == "password" and (username) == "MrLee123":
  8.         import time
  9.         time.sleep(1)
  10.         print("Username and password accepted")
  11.         print("Choose a student")
  12.         print("1.) Hanif Adolecense")
  13.         print("2.) Kerlo Sumpage")
  14.         print("3.) Kearien Honter")
  15.         print("4.) Mex Whitermen")
  16.         print("5.) Tolu Ohyeahbola")
  17.         print("6.) Konstipated De Bruen")
  18.         print("7,) Alegandro Azzzznaar")
  19.         print("8.) Ben Inmen")
  20.         print("9,) Tomas Woodhouse")
  21.         print("10.) Ruth Macewan")
  22.         print("11.) Matrew Hogwarts")
  23.         print("12.) Dilan Vaughan")
  24.         print("13.) Nafanial Ballaaaad")
  25.         print("14.) Laluwa Niyi Afuya")
  26.         print("15.) Scooter Burrow")
  27.         print("16.) Elred Marten Lawsun")
  28.         print("17.) Jaime Beltranee")
  29.         print("18.) Looke Oakly")
  30.         print("Press enter to quit")
  31.         answer = input("Select an option r = read, w = write eg w1 ")
  32.         numberoftries = 0
  33.         if answer == "w1":
  34.             student1 = []
  35.             student1.append(input("Enter his given name"))
  36.             student1.append(input("Enter his surname"))
  37.             student1.append(input("Enter his ID Number"))
  38.             student1.append(input("Enter his Date of birth"))
  39.             student1.append(input("Enter his gender"))
  40.             student1.append(input("Enter his tutor group"))
  41.             student1.append(input("Enter his place of birth"))
  42.             student1.append(input("Enter his school email"))
  43.             f = open("H:\\Computing\\Unit 3\\MrLee\\Hanif.txt", "w")
  44.             for item in student1:
  45.                 f.write(str(item) + "\n")
  46.                 print("Written")
  47.             f.close()
  48.         elif(answer) == "r1":
  49.             f = open("H:\\Computing\\Unit 3\\MrLee\\Hanif.txt", "r")
  50.             for item in range(0, 9):
  51.                 content = f.readline()
  52.                 print(content)
  53.         if answer == "w2":
  54.             student2 = []
  55.             student2.append(input("Enter his given name"))
  56.             student2.append(input("Enter his surname"))
  57.             student2.append(input("Enter his ID Number"))
  58.             student2.append(input("Enter his Date of birth"))
  59.             student2.append(input("Enter his gender"))
  60.             student2.append(input("Enter his tutor group"))
  61.             student2.append(input("Enter his place of birth"))
  62.             student2.append(input("Enter his school email"))
  63.             f = open("H:\\Computing\\Unit 3\\MrLee\\Kerlo.txt", "w")
  64.             for item in student2:
  65.                 f.write(str(item) + "\n")
  66.                 print("Written")
  67.             f.close()
  68.         elif(answer) == "r2":
  69.             f = open("H:\\Computing\\Unit 3\\MrLee\\Kerlo.txt", "r")
  70.             for item in range(0, 9):
  71.                 content = f.readline()
  72.                 print(content)
  73.         if answer == "w3":
  74.             student3 = []
  75.             student3.append(input("Enter his given name"))
  76.             student3.append(input("Enter his surname"))
  77.             student3.append(input("Enter his ID Number"))
  78.             student3.append(input("Enter his Date of birth"))
  79.             student3.append(input("Enter his gender"))
  80.             student3.append(input("Enter his tutor group"))
  81.             student3.append(input("Enter his place of birth"))
  82.             student3.append(input("Enter his school email"))
  83.             f = open("H:\\Computing\\Unit 3\\MrLee\\Kearian.txt", "w")
  84.             for item in student3:
  85.                 f.write(str(item) + "\n")
  86.                 print("Written")
  87.             f.close()
  88.         elif(answer) == "r3":
  89.             f = open("H:\\Computing\\Unit 3\\MrLee\\Kearian.txt", "r")
  90.             for item in range(0, 9):
  91.                 content = f.readline()
  92.                 print(content)
  93.         if answer == "w4":
  94.             student4 = []
  95.             student4.append(input("Enter his given name"))
  96.             student4.append(input("Enter his surname"))
  97.             student4.append(input("Enter his ID Number"))
  98.             student4.append(input("Enter his Date of birth"))
  99.             student4.append(input("Enter his gender"))
  100.             student4.append(input("Enter his tutor group"))
  101.             student4.append(input("Enter his place of birth"))
  102.             student4.append(input("Enter his school email"))
  103.             f = open("H:\\Computing\\Unit 3\\MrLee\\Mex.txt", "w")
  104.             for item in student4:
  105.                 f.write(str(item) + "\n")
  106.                 print("Written")
  107.             f.close()
  108.         elif(answer) == "r4":
  109.             f = open("H:\\Computing\\Unit 3\\MrLee\\Mex.txt", "r")
  110.             for item in range(0, 9):
  111.                 content = f.readline()
  112.                 print(content)
  113.         if answer == "w5":
  114.             student5 = []
  115.             student5.append(input("Enter his given name"))
  116.             student5.append(input("Enter his surname"))
  117.             student5.append(input("Enter his ID Number"))
  118.             student5.append(input("Enter his Date of birth"))
  119.             student5.append(input("Enter his gender"))
  120.             student5.append(input("Enter his tutor group"))
  121.             student5.append(input("Enter his place of birth"))
  122.             student5.append(input("Enter his school email"))
  123.             f = open("H:\\Computing\\Unit 3\\MrLee\\Tolu.txt", "w")
  124.             for item in student5:
  125.                 f.write(str(item) + "\n")
  126.                 print("Written")
  127.             f.close()
  128.         elif(answer) == "r5":
  129.             f = open("H:\\Computing\\Unit 3\\MrLee\\Tolu.txt", "r")
  130.             for item in range(0, 9):
  131.                 content = f.readline()
  132.                 print(content)
  133.         if answer == "w6":
  134.             student6 = []
  135.             student6.append(input("Enter his given name"))
  136.             student6.append(input("Enter his surname"))
  137.             student6.append(input("Enter his ID Number"))
  138.             student6.append(input("Enter his Date of birth"))
  139.             student6.append(input("Enter his gender"))
  140.             student6.append(input("Enter his tutor group"))
  141.             student6.append(input("Enter his place of birth"))
  142.             student6.append(input("Enter his school email"))
  143.             f = open("H:\\Computing\\Unit 3\\MrLee\\Konstipated.txt", "w")
  144.             for item in student6:
  145.                 f.write(str(item) + "\n")
  146.                 print("Written")
  147.             f.close()
  148.         elif(answer) == "r6":
  149.             f = open("H:\\Computing\\Unit 3\\MrLee\\Konstipated.txt", "r")
  150.             for item in range(0, 9):
  151.                 content = f.readline()
  152.                 print(content)
  153.         if answer == "w7":
  154.             student7 = []
  155.             student7.append(input("Enter his given name"))
  156.             student7.append(input("Enter his surname"))
  157.             student7.append(input("Enter his ID Number"))
  158.             student7.append(input("Enter his Date of birth"))
  159.             student7.append(input("Enter his gender"))
  160.             student7.append(input("Enter his tutor group"))
  161.             student7.append(input("Enter his place of birth"))
  162.             student7.append(input("Enter his school email"))
  163.             f = open("H:\\Computing\\Unit 3\\MrLee\\Alegandro.txt", "w")
  164.             for item in student7:
  165.                 f.write(str(item) + "\n")
  166.                 print("Written")
  167.             f.close()
  168.         elif(answer) == "r7":
  169.             f = open("H:\\Computing\\Unit 3\\MrLee\\Alegandro.txt", "r")
  170.             for item in range(0, 9):
  171.                 content = f.readline()
  172.                 print(content)
  173.         if answer == "w8":
  174.             student8 = []
  175.             student8.append(input("Enter his given name"))
  176.             student8.append(input("Enter his surname"))
  177.             student8.append(input("Enter his ID Number"))
  178.             student8.append(input("Enter his Date of birth"))
  179.             student8.append(input("Enter his gender"))
  180.             student8.append(input("Enter his tutor group"))
  181.             student8.append(input("Enter his place of birth"))
  182.             student8.append(input("Enter his school email"))
  183.             f = open("H:\\Computing\\Unit 3\\MrLee\\Ben.txt", "w")
  184.             for item in student8:
  185.                 f.write(str(item) + "\n")
  186.                 print("Written")
  187.             f.close()
  188.         elif(answer) == "r8":
  189.             f = open("H:\\Computing\\Unit 3\\MrLee\\Ben.txt", "r")
  190.             for item in range(0, 9):
  191.                 content = f.readline()
  192.                 print(content)
  193.         if answer == "w9":
  194.             student9 = []
  195.             student9.append(input("Enter his given name"))
  196.             student9.append(input("Enter his surname"))
  197.             student9.append(input("Enter his ID Number"))
  198.             student9.append(input("Enter his Date of birth"))
  199.             student9.append(input("Enter his gender"))
  200.             student9.append(input("Enter his tutor group"))
  201.             student9.append(input("Enter his place of birth"))
  202.             student9.append(input("Enter his school email"))
  203.             f = open("H:\\Computing\\Unit 3\\MrLee\\Tomas.txt", "w")
  204.             for item in student6:
  205.                 f.write(str(item) + "\n")
  206.                 print("Written")
  207.             f.close()
  208.         elif(answer) == "r9":
  209.             f = open("H:\\Computing\\Unit 3\\MrLee\\Tomas.txt", "r")
  210.             for item in range(0, 9):
  211.                 content = f.readline()
  212.                 print(content)
  213.         if answer == "w10":
  214.             student10 = []
  215.             student10.append(input("Enter his given name"))
  216.             student10.append(input("Enter his surname"))
  217.             student10.append(input("Enter his ID Number"))
  218.             student10.append(input("Enter his Date of birth"))
  219.             student10.append(input("Enter his gender"))
  220.             student10.append(input("Enter his tutor group"))
  221.             student10.append(input("Enter his place of birth"))
  222.             student10.append(input("Enter his school email"))
  223.             f = open("H:\\Computing\\Unit 3\\MrLee\\Ruth.txt", "w")
  224.             for item in student10:
  225.                 f.write(str(item) + "\n")
  226.                 print("Written")
  227.             f.close()
  228.         elif(answer) == "r10":
  229.             f = open("H:\\Computing\\Unit 3\\MrLee\\Ruth.txt", "r")
  230.             for item in range(0, 9):
  231.                 content = f.readline()
  232.                 print(content)
  233.         if answer == "w11":
  234.             student11 = []
  235.             student11.append(input("Enter his given name"))
  236.             student11.append(input("Enter his surname"))
  237.             student11.append(input("Enter his ID Number"))
  238.             student11.append(input("Enter his Date of birth"))
  239.             student11.append(input("Enter his gender"))
  240.             student11.append(input("Enter his tutor group"))
  241.             student11.append(input("Enter his place of birth"))
  242.             student11.append(input("Enter his school email"))
  243.             f = open("H:\\Computing\\Unit 3\\MrLee\\Matrew.txt", "w")
  244.             for item in student11:
  245.                 f.write(str(item) + "\n")
  246.                 print("Written")
  247.             f.close()
  248.         elif(answer) == "r11":
  249.             f = open("H:\\Computing\\Unit 3\\MrLee\\Matrew.txt", "r")
  250.             for item in range(0, 9):
  251.                 content = f.readline()
  252.                 print(content)
  253.         if answer == "w12":
  254.             student12 = []
  255.             student12.append(input("Enter his given name"))
  256.             student12.append(input("Enter his surname"))
  257.             student12.append(input("Enter his ID Number"))
  258.             student12.append(input("Enter his Date of birth"))
  259.             student12.append(input("Enter his gender"))
  260.             student12.append(input("Enter his tutor group"))
  261.             student12.append(input("Enter his place of birth"))
  262.             student12.append(input("Enter his school email"))
  263.             f = open("H:\\Computing\\Unit 3\\MrLee\\Dilan.txt", "w")
  264.             for item in student12:
  265.                 f.write(str(item) + "\n")
  266.                 print("Written")
  267.             f.close()
  268.         elif(answer) == "r12":
  269.             f = open("H:\\Computing\\Unit 3\\MrLee\\Dilan.txt", "r")
  270.             for item in range(0, 9):
  271.                 content = f.readline()
  272.                 print(content)
  273.         if answer == "w13":
  274.             student13 = []
  275.             student13.append(input("Enter his given name"))
  276.             student13.append(input("Enter his surname"))
  277.             student13.append(input("Enter his ID Number"))
  278.             student13.append(input("Enter his Date of birth"))
  279.             student13.append(input("Enter his gender"))
  280.             student13.append(input("Enter his tutor group"))
  281.             student13.append(input("Enter his place of birth"))
  282.             student13.append(input("Enter his school email"))
  283.             f = open("H:\\Computing\\Unit 3\\MrLee\\Nafanial.txt", "w")
  284.             for item in student13:
  285.                 f.write(str(item) + "\n")
  286.                 print("Written")
  287.             f.close()
  288.         elif(answer) == "r13":
  289.             f = open("H:\\Computing\\Unit 3\\MrLee\\Nafanial.txt", "r")
  290.             for item in range(0, 9):
  291.                 content = f.readline()
  292.                 print(content)
  293.         if answer == "w14":
  294.             student14 = []
  295.             student14.append(input("Enter his given name"))
  296.             student14.append(input("Enter his surname"))
  297.             student14.append(input("Enter his ID Number"))
  298.             student14.append(input("Enter his Date of birth"))
  299.             student14.append(input("Enter his gender"))
  300.             student14.append(input("Enter his tutor group"))
  301.             student14.append(input("Enter his place of birth"))
  302.             student14.append(input("Enter his school email"))
  303.             f = open("H:\\Computing\\Unit 3\\MrLee\\Laluwa.txt", "w")
  304.             for item in student14:
  305.                 f.write(str(item) + "\n")
  306.                 print("Written")
  307.             f.close()
  308.         elif(answer) == "r14":
  309.             f = open("H:\\Computing\\Unit 3\\MrLee\\Laluwa.txt", "r")
  310.             for item in range(0, 9):
  311.                 content = f.readline()
  312.                 print(content)
  313.         if answer == "w15":
  314.             student15 = []
  315.             student15.append(input("Enter his given name"))
  316.             student15.append(input("Enter his surname"))
  317.             student15.append(input("Enter his ID Number"))
  318.             student15.append(input("Enter his Date of birth"))
  319.             student15.append(input("Enter his gender"))
  320.             student15.append(input("Enter his tutor group"))
  321.             student15.append(input("Enter his place of birth"))
  322.             student15.append(input("Enter his school email"))
  323.             f = open("H:\\Computing\\Unit 3\\MrLee\\Scooter.txt", "w")
  324.             for item in student15:
  325.                 f.write(str(item) + "\n")
  326.                 print("Written")
  327.             f.close()
  328.         elif(answer) == "r15":
  329.             f = open("H:\\Computing\\Unit 3\\MrLee\\Scooter.txt", "r")
  330.             for item in range(0, 9):
  331.                 content = f.readline()
  332.                 print(content)
  333.         if answer == "w16":
  334.             student16 = []
  335.             student16.append(input("Enter his given name"))
  336.             student16.append(input("Enter his surname"))
  337.             student16.append(input("Enter his ID Number"))
  338.             student16.append(input("Enter his Date of birth"))
  339.             student16.append(input("Enter his gender"))
  340.             student16.append(input("Enter his tutor group"))
  341.             student16.append(input("Enter his place of birth"))
  342.             student16.append(input("Enter his school email"))
  343.             f = open("H:\\Computing\\Unit 3\\MrLee\\Elred.txt", "w")
  344.             for item in student16:
  345.                 f.write(str(item) + "\n")
  346.                 print("Written")
  347.             f.close()
  348.         elif(answer) == "r16":
  349.             f = open("H:\\Computing\\Unit 3\\MrLee\\Elred.txt", "r")
  350.             for item in range(0, 9):
  351.                 content = f.readline()
  352.                 print(content)
  353.         if answer == "w17":
  354.             student17 = []
  355.             student17.append(input("Enter his given name"))
  356.             student17.append(input("Enter his surname"))
  357.             student17.append(input("Enter his ID Number"))
  358.             student17.append(input("Enter his Date of birth"))
  359.             student17.append(input("Enter his gender"))
  360.             student17.append(input("Enter his tutor group"))
  361.             student17.append(input("Enter his place of birth"))
  362.             student17.append(input("Enter his school email"))
  363.             f = open("H:\\Computing\\Unit 3\\MrLee\\Jaime.txt", "w")
  364.             for item in student17:
  365.                 f.write(str(item) + "\n")
  366.                 print("Written")
  367.             f.close()
  368.         elif(answer) == "r17":
  369.             f = open("H:\\Computing\\Unit 3\\MrLee\\jaime.txt", "r")
  370.             for item in range(0, 9):
  371.                 content = f.readline()
  372.                 print(content)
  373.         if answer == "w18":
  374.             student18 = []
  375.             student18.append(input("Enter his given name"))
  376.             student18.append(input("Enter his surname"))
  377.             student18.append(input("Enter his ID Number"))
  378.             student18.append(input("Enter his Date of birth"))
  379.             student18.append(input("Enter his gender"))
  380.             student18.append(input("Enter his tutor group"))
  381.             student18.append(input("Enter his place of birth"))
  382.             student18.append(input("Enter his school email"))
  383.             f = open("H:\\Computing\\Unit 3\\MrLee\\Looke.txt", "w")
  384.             for item in student18:
  385.                 f.write(str(item) + "\n")
  386.                 print("Written")
  387.             f.close()
  388.         elif(answer) == "r18":
  389.             f = open("H:\\Computing\\Unit 3\\MrLee\\Looke.txt", "r")
  390.             for item in range(0, 9):
  391.                 content = f.readline()
  392.                 print(content)
  393.                        
  394.     else:
  395.         print("try again")
  396.         numberoftries -= 1
  397.         if numberoftries == 0:
  398.             print("Too many attempts")
  399. input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement