def f1(l):
l.set_dashes([2, 2, 10, 2])
fig, ax = plt.subplots()
line1, = ax.plot(x, y)
f1(line1)
import datetime
import locale
locale.setlocale(locale.LC_ALL, 'ru_RU.UTF-8')
mydate = datetime.datetime.now()
mydate.strftime("%B")
mydate.strftime("%A")
'Сентябрь'
'вторник'
text= open('text.txt', 'r')
line = text.readline()
i=0
while line:
print (line),
if line=='word':
ns=i
break
line = text.readline()
i+=1
text.close()
print ('Номер нужной строки ',ns)
text= open('text.txt', 'r')
for id, line in enumerate(text.readlines()):
print (line)
if line=='word':
break
text.close()
print ('Номер нужной строки ',id)
a='a abc ccc cvv v'
b=a.split()
c=[]
for i in b[::-1]:
if len(i)>=3 and len(i)<=5:
c.append(i)
b.remove(i)
print ( c)
print (b)
['cvv', 'ccc', 'abc']
['a', 'v']
c.reverse()
print ( c)
['cvv', 'ccc', 'abc']