Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def match(questionType):
- total = []
- q = '{}.txt'.format(questionType)
- answer = 'answer{}.txt'.format(questionType)
- with open(q,'r') as fque:
- with open(answer,'r') as fans:
- questions = fque.readlines()
- answer = fans.readlines()
- result = []
- count = 0
- countans = 0
- while True:
- if count == len(questions):
- result.append(questions[count])
- result.append(answer[count])
- count += 1
- countans +=1
- total.append(result)
- elif answer = '\n':
- count +=2
- countans += 2
- else:
- break
- return total
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement