Writing Python Program N Friends Meeting Go Trip Month Entering Schedule Write Python Prog Q43784638
Writing python program:
There are n friends meeting to go on a trip this month, each ofthem entering their own schedule,
Write a python program, count all the available hours for everyone,and print it.
When q is input, Output statistical values
If no time is available, output: no trip this time
30 days a month
‘4-5’ means → ‘day4-day5’
Ex:
Input:
preson1:4-5,11-12,18-19,25-30
preson2:15-19, 21-28, 30-31
preson3: q
<person1 and person2 possible times are >
day: 18 19 25 26 27 28 30
ex.
preson1: 9
preson2: 1-2, 4-6,15-28
preson3:q
Reference function:
가능한 날짜: 7~16 18 25~27 가능한 날짜: 9~11 24~31 가능한 날짜: 1~15 11 25~26 가능한 날짜: q <3명이 모두 가능한 날> 9일 10일 25일 26일 가능한 날짜: 1 5 6~11 9 가능한 날짜: 8 20~31 가능한 날짜: 9 12 7 가능한 날짜: 11 13~20 가능한 날짜: q <4명이 모두 가능한 날> 없습니다. 다음 기회에 가능한 날짜: 4~5 11~12 18~19 25~30 가능한 날짜: 30~31 21~28 15~19 가능한 날짜: q <2명이 모두 가능한 날> 18일 19일 25일 26일 27일 28일 30일 >>> a=[1,2,3,4] >>> a.append([5, 6, 7, 8]) >>> a=[1,2,3,4] >>> a.extend([5, 6, 7, 8]) >>> a >>> a [1, 2, 3, 4, 5, 6, 7, 8] [1, 2, 3, 4, [5, 6, 7, 8]] Show transcribed image text 가능한 날짜: 7~16 18 25~27 가능한 날짜: 9~11 24~31 가능한 날짜: 1~15 11 25~26 가능한 날짜: q 9일 10일 25일 26일 가능한 날짜: 1 5 6~11 9 가능한 날짜: 8 20~31 가능한 날짜: 9 12 7 가능한 날짜: 11 13~20 가능한 날짜: q 없습니다. 다음 기회에 가능한 날짜: 4~5 11~12 18~19 25~30 가능한 날짜: 30~31 21~28 15~19 가능한 날짜: q 18일 19일 25일 26일 27일 28일 30일
>>> a=[1,2,3,4] >>> a.append([5, 6, 7, 8]) >>> a=[1,2,3,4] >>> a.extend([5, 6, 7, 8]) >>> a >>> a [1, 2, 3, 4, 5, 6, 7, 8] [1, 2, 3, 4, [5, 6, 7, 8]]
Expert Answer
Answer to Writing python program: There are n friends meeting to go on a trip this month, each of them entering their own schedule…
OR