Skip to content

Instantly share code, notes, and snippets.

@AlexDel
Last active May 11, 2018 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexDel/e21fc855f50f9fddb5f786e95cda0b43 to your computer and use it in GitHub Desktop.
Save AlexDel/e21fc855f50f9fddb5f786e95cda0b43 to your computer and use it in GitHub Desktop.
file = open('tasks.txt', 'r', encoding='utf-8')
task = file.read()
import re
def defineSuitableline(line):
suitableForTask = False
words = re.split('\W', line)
for word in words:
if word == 'e-mail' or word == 'email' or word == 'forum' or word == 'blog' or word == 'twitter' or word == 'web' or words == 'website':
suitableForTask = True
break
return suitableForTask
def processLinesName(text):
CMCtasks = []
NotCMCtasks = []
strings = text.split ('\n')
for string in strings:
if defineSuitableline(string):
CMCtasks.append (string)
print('Задание "' + string + '" можно использовать для тренировки навыков компьютерно-опосредованной коммуникации.')
else:
NotCMCtasks.append (string)
return (CMCtasks, NotCMCtasks)
processedTasks = processLinesName(task)
print('Задания, подходящие для развития навыков КОК:', processedTasks[0])
print('Остальные задания:', processedTasks[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment