From 4049fa858ad9207920aee2e5a60dfb61ab94e7ef Mon Sep 17 00:00:00 2001 From: Diego Raposo Date: Wed, 9 Oct 2024 11:34:10 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20"Criada=20a=20fun=C3=A7=C3=A3o=20para?= =?UTF-8?q?=20verifica=20se=20h=C3=A1=20duplicatas=20em=20um=20array"=20Cr?= =?UTF-8?q?iei=20a=20fun=C3=A7=C3=A3o=20que=20verifica=20se=20h=C3=A1=20du?= =?UTF-8?q?plicata=20em=20um=20array=20e=20retorna=20falso=20se=20n=C3=A3o?= =?UTF-8?q?=20h=C3=A1=20elementos=20distindos=20e=20verdadeiro=20se=20h?= =?UTF-8?q?=C3=A1=20elementos=20distintos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/array.py | 11 +++++++++++ src/features/times.py | 9 +++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/array.py diff --git a/src/array.py b/src/array.py new file mode 100644 index 0000000..033c7f7 --- /dev/null +++ b/src/array.py @@ -0,0 +1,11 @@ + +def verifica_duplicata(): + array = [1,2,3,4,5,1] + if not(len(array) == len(set(array))) == False: + print(False) + print("Não há elementos distintos") + else: + print(True) + print("Há elementos distintos") + +verifica_duplicata() \ No newline at end of file diff --git a/src/features/times.py b/src/features/times.py index e69de29..843f532 100644 --- a/src/features/times.py +++ b/src/features/times.py @@ -0,0 +1,9 @@ +def times(a,b) + """ + Função para subtrair dois números. + + :param a: Primeiro número + :param b: Segundo número + :return: A subtração de a e b + """ + return a*b \ No newline at end of file