Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Practice/Karpov_A/Lec_7/t7_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from datetime import datetime
from datetime import timedelta

start_date = '01-08-2020'
end_date = '10-09-2020'

def working_day(statr_date, end_date):
fd = datetime.strptime(start_date, '%d-%m-%Y')
ld = datetime.strptime(end_date, '%d-%m-%Y')
zoom = ld - fd
date = fd
work_days = 0
for i in range(int(zoom.days)+1):
if date.strftime('%A') != 'Saturday' and date.strftime('%A') != 'Sunday':
Comment thread
cool07 marked this conversation as resolved.
work_days += 1
date += timedelta(days=1)
return work_days
print(working_day(start_date, end_date))
8 changes: 8 additions & 0 deletions Practice/Karpov_A/Lec_7/t7_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import subprocess


def read(file):
subprocess.run(['type', file], shell=True)


read(r"E:\Работы по программированию\Python\DZ_6_lec7\text.txt")
1 change: 1 addition & 0 deletions Practice/Karpov_A/Lec_7/text.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello!!! How are you!