Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- firstnames = ['Anthony', 'Timothy', 'Bob', 'Sean', 'John', 'Ivan', 'Sergey', 'Peter', 'Anton', 'Nikolas', 'Armen']
- lastnames = ['Smith', 'Parker', 'Conrad', 'Washington', 'Kennedy']
- coordinatorset = {'role': 'coordinator', 'capacity': 1000000, 'fuelhrusage': 1, 'hardware': 0, 'hardwareusage': 0, 'hrdistance': 20, 'weapons': 'Yes', 'ammunition': 1000, 'ammunitionhrusage': 100}
- infectorset = {'role': 'infector', 'capacity': 500000, 'fuelhrusage': 2, 'hardware': 1000, 'hardwareusage': 10, 'hrdistance': 15, 'weapons': 'No', 'ammunition': 0, 'ammunitionhrusage': 0}
- soldierset = {'role': 'soldier', 'capacity': 500000, 'fuelhrusage': 2, 'hardware': 0, 'hardwareusage': 0, 'hrdistance': 20, 'weapons': 'Yes', 'ammunition': 2000, 'ammunitionhrusage': 200}
- technicianset = {'role': 'technician', 'capacity': 500000, 'fuelhrusage': 3, 'hardware': 1000, 'hardwareusage': 20, 'hrdistance': 15, 'weapons': 'Yes', 'ammunition': 1000, 'ammunitionhrusage': 100}
- scoutset = {'role': 'scout', 'capacity': 1000000, 'fuelhrusage': 2, 'hardware': 0, 'hardwareusage': 0, 'hrdistance': 30, 'weapons': 'Yes', 'ammunition': 1000, 'ammunitionhrusage': 100}
- workerset = {'role': 'worker', 'capacity': 500000, 'fuelhrusage': 3, 'hardware': 1500, 'hardwareusage': 40, 'hrdistance': 10, 'weapons': 'No', 'ammunition': 0, 'ammunitionhrusage': 0}
- fsets = [coordinatorset, infectorset, soldierset, technicianset, scoutset, workerset]
- i = 0
- b = 0
- for item in lastnames:
- c = 0
- for item in firstnames:
- tempdict = {'alias': firstnames[i] + lastnames[b], 'firstname': firstnames[i], 'familyname': lastnames[b]}
- if tempdict['firstname'] == 'Anthony':
- tempdict.update(coordinatorset)
- elif tempdict['firstname'] != 'Anthony' and c < len(fsets)-1:
- tempdict.update(fsets[c])
- elif tempdict['firstname'] != 'Anthony' and c == len(fsets)-1:
- tempdict.update(fsets[c])
- c = 0
- file = open(lastnames[b] + ".txt", 'a')
- file.write(str(tempdict) + '\n')
- file.close()
- tempdict = {}
- i = i + 1
- c = c + 1
- if i >= len(firstnames):
- file = open("Families.txt", 'a')
- file.write(lastnames[b] + '\n')
- file.close()
- b = b + 1
- i = 0
- print ('All is OK!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement