-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from gabrielbdornas/corrige-exercicio-descricao-5
Corrige exercicio descricao 5
- Loading branch information
Showing
16 changed files
with
118 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
def hello_world(): | ||
# TODO: Retorne a string 'Olá Mundo' e mostre para todos que você está On!! | ||
pass | ||
return 'Olá mundo' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
def my_github_nickname_is(): | ||
# TODO: Retorne seu usuário github. | ||
pass | ||
return 'gabrielbdornas' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,30 @@ | ||
def add(first_number, second_number): | ||
# TODO: retorne a soma dos parâmetros first_number e second_number | ||
pass | ||
return first_number + second_number | ||
|
||
def sub(first_number, second_number): | ||
# TODO: retorne a subtração dos parâmetros first_number e second_number | ||
pass | ||
return first_number - second_number | ||
|
||
def mult(first_number, second_number): | ||
# TODO: retorne a multiplicação dos parâmetros first_number e second_number | ||
pass | ||
return first_number * second_number | ||
|
||
def div(first_number, second_number): | ||
# TODO: retorne a divisão dos parâmetros first_number e second_number | ||
pass | ||
return first_number / second_number | ||
|
||
def expo(first_number, second_number): | ||
# TODO: retorne a exponenciação dos parâmetros first_number e second_number | ||
pass | ||
return first_number ** second_number | ||
|
||
def remai(first_number, second_number): | ||
# TODO: retorne o resto da divisão dos parâmetros first_number e second_number | ||
pass | ||
return first_number % second_number | ||
|
||
def quoti_remai(first_number, second_number): | ||
# TODO: retorne o quociente e o resto da divisão, nesta exata ordem, dos parâmetros first_number e second_number | ||
# Hint: Utilize a vírgula para separar os dois valores retornados na função | ||
pass | ||
quoti = first_number // second_number | ||
rem = remai(first_number, second_number) | ||
return quoti, rem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
def circle_area(radius): | ||
# TODO: Retorne a área de um círculo dado a medida de seu raio | ||
# Auxílio: Utilize 3.14 como valor do Pi | ||
pass | ||
return 3.14*radius**2 | ||
|
||
|
||
def square_area(side): | ||
# TODO: Retorne a área de um quadrado dado a medida de seu lado | ||
pass | ||
return side * side | ||
|
||
def rectangle_area(side, base): | ||
# TODO: Retorne a área de um retângulo dado a medida de seu lado e de sua base | ||
pass | ||
return side * base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
web_dev_challenges/01_essencial/05_strings/learn_strings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
def has_letter(letter, input_word): | ||
# TODO: Retorne True ou False para a existência da letra (letter) no texto informado (string) | ||
pass | ||
return letter in input_word | ||
|
||
def uper_case(input_word): | ||
# TODO: Retorne o valor to texto todo em letras maiúsculas | ||
pass | ||
return input_word.upper() | ||
|
||
|
||
def lower_case(input_word): | ||
# TODO: Retorne o valor to texto todo em letras minúsculas | ||
pass | ||
return input_word.lower() | ||
|
||
def capitalize(input_word): | ||
# TODO: Retorne o valor to texto todo com a primeira letra maiúscula | ||
pass | ||
return input_word.title() | ||
|
||
def reverse(input_word): | ||
# TODO: Retorne o valor inverso de um texto | ||
pass | ||
return input_word[::-1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
def calculator(): | ||
# TODO: Retorne o resultado da adição dos números informados pelo usuário | ||
pass | ||
primeiro_valor = input('Informe o primeiro números: ') | ||
segundo_valor = input('Informe o segundo números: ') | ||
return primeiro_valor + segundo_valor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 11 additions & 8 deletions
19
web_dev_challenges/02_lists_tuple_dict/01_lista_diversos/list_methods.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,36 @@ | ||
def sort_asc(my_list): | ||
# TODO: Retorne a lista de nomes recebida em ordem alfabética ascendente | ||
pass | ||
my_list.sort() | ||
return my_list | ||
|
||
def sort_desc(my_list): | ||
# TODO: Retorne a lista de nomes recebida em ordem alfabética descendente | ||
pass | ||
my_list.sort(reverse = True) | ||
return my_list | ||
|
||
def find_list_element(my_list): | ||
# TODO: Retorne o segundo elemento da lista recebida | ||
pass | ||
return my_list[1] | ||
|
||
def find_last_list_element(my_list): | ||
# TODO: Retorne o último elemento da lista recebida | ||
pass | ||
return my_list[-1] | ||
|
||
def find_out_of_range_error(): | ||
# TODO: Encontrar o erro no código abaixo | ||
# TODO: my_list não deverá ser modificada | ||
my_list = [1, 2, 3, 4, 5] | ||
return my_list[5] | ||
return my_list[4] | ||
|
||
def x_not_in_the_list_error(): | ||
# TODO: Encontrar o erro no código abaixo | ||
# TODO: my_list não deverá ser modificada | ||
# TODO: Último elemento da lista deverá ser removido | ||
my_list = [1, 2, 3, 4, 5] | ||
my_list.remove(6) | ||
my_list.remove(5) | ||
return my_list[0] | ||
|
||
def list_remove_last(my_list): | ||
# TODO: Retorne a lista recebida como argumento sem o último elemento | ||
pass | ||
# TODO: Remover a lista recebida como argumento sem o último elemento | ||
del my_list[-1] | ||
return my_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
web_dev_challenges/02_lists_tuple_dict/03_tuple_diversos/tuple_methods.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
def tuple_sum(): | ||
# TODO: Calcule a soma dos elementos da tupla 'my_tuple' | ||
my_tuple = 1, 2, 3, 4, 5 | ||
pass | ||
return sum(my_tuple) | ||
|
||
def find_second_element(): | ||
# TODO: Retorne o segundo elemento da tupla 'my_tuple' | ||
my_tuple = 1, 2, 3, 4, 5 | ||
pass | ||
return my_tuple[1] | ||
|
||
def find_out_typle_error(): | ||
# TODO: Encontrar o erro no código abaixo | ||
# TODO: my_tuple não deverá ser modificada | ||
my_tuple = 1, 2, 3, 4, 5 | ||
typle.remove(1) | ||
return my_tuple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
def can_vote(age): | ||
# TODO: Sendo informado a idade retorne a informação se a pessoa poderá votar (True) ou não (False) | ||
# TODO: Poderão votar pessoas com 18 anos ou mais | ||
pass | ||
if age >= 18: | ||
return True | ||
else: | ||
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters