_s8

Tinkering

_s8
Aug 20th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.94 KB | None | 0 0
  1. class Mainframe:
  2.     phoneData = []
  3.     # Waiting till I need it ^^^^
  4. class phoneProcessing:
  5.     restartValue = 0
  6.     stored_phoneNumbers = []
  7. # Assign the phone number
  8. # (And by the way, I know it doesn't charge stuff from paypal yet, and that's because I'm not really good with bs4 yet.)
  9. def assign_number(zipCode, First_Name, Last_Name):
  10.     def restart(First_Name, Last_Name, ZipCode):
  11.         phoneProcessing.restartValue = 1
  12.         assign_number(ZipCode, First_Name, Last_Name)
  13.     for loops in range(0, len(Mainframe.phoneData), 1):
  14.         SnoopingList = ["Name: " + str(First_Name) + " " + str(Last_Name) + " Zip Code: " + str(zipCode),]
  15.         if Mainframe.phoneData[loops] == SnoopingList:
  16.             print("Denied.")
  17.         else:
  18.             # Formula for assigning phone numbers (Not the real formula)
  19.             phoneformula = (str(zipCode[0])+str(zipCode[1])+str(zipCode[2]))+"-"+str(len(First_Name))+str(len(Last_Name))
  20.             if len(phoneformula) < 16:
  21.                 # Wrote this variable so I didn't have to write another 20 lines of code
  22.                 difference = 16-len(phoneformula)
  23.                 for loops in range(0, difference, 1):
  24.                     while phoneformula < 16:
  25.                         phoneformula + str(loops)
  26.                     if phoneformula == 16:
  27.                         break
  28.                         update = [phoneformula]
  29.                         phoneProcessing.stored_phoneNumbers = update
  30.                         restart(First_Name, Last_Name, zipCode)
  31.                         return loops
  32.             if len(phoneformula) == 16 or phoneProcessing.restartValue == 1:
  33.                 # Made an update list so I could add it to the phone data for the Mainframe
  34.                 updateList = ["Name: "+str(First_Name)+" "+str(Last_Name)+" Zip Code: "+str(zipCode),]
  35.                 Mainframe.phoneData + updateList
  36. # Wow, 36 lines of code for one function? And all it is is sorting....
Advertisement
Add Comment
Please, Sign In to add comment