Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit acd64c8

Browse files
committed
feat: 🔥 Desenvolvendo função study_schedule
Criado a função para percorer uma lista e identificar quantos alunos estão estudando o mesmo tempo
1 parent 43652fd commit acd64c8

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
def is_palindrome_recursive(word, low_index, high_index):
2-
"""Faça o código aqui."""
3-
raise NotImplementedError
2+
pass
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
def study_schedule(permanence_period, target_time):
2-
"""Faça o código aqui."""
3-
raise NotImplementedError
2+
counter = 0
3+
4+
for period in permanence_period:
5+
try:
6+
if period[0] <= target_time <= period[1]:
7+
counter += 1
8+
except TypeError:
9+
return None
10+
11+
return counter
12+
13+
14+
print(study_schedule([(2, 2), (1, 2), (2, 3), (1, 5), (4, 5)], 3))

0 commit comments

Comments
 (0)