Python
8
Вклад в тег
import csv
holiday = input ()
with open('file.csv') as f:
readCSV = csv.reader(f, delimeter=',')
for row in readCSV:
if holiday == row[0]:
print('ok')
import csv
year = input()
mont = input()
day = input()
with open('33.csv', encoding='utf-8') as f:
readCSV = csv.reader(f, delimiter=',')
for row in readCSV:
if year == row[0]:
months = row[1:12]
i = int(int(mont) - 1)
if day or day+"*" not in months[i]:
print("Выходной")
else:
print("Рабочий")
def invalid_username_validator(value):
abc = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','r','q','s',
't','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','-','_']
for i in range(len(value)):
if value[i] not in abc:
raise ValidationError(u'Недопустимые символы ( {} )'.format(value[i]))
import re
c = "Иван"
if re.search('^[A-Za-z0-9]*$',c, re.UNICODE):
# если нужны только маленькие латинские [a-z0-9]
# do something
else:
# do something