generated from reprograma/onX-sx-temaX
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exercicios da semana2 🥳 🤯 #27
Open
Marciatkm
wants to merge
1
commit into
reprograma:main
Choose a base branch
from
Marciatkm:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
#Faça um Programa para uma loja de tintas. O programa deverá pedir o tamanho em metros quadrados da área a ser pintada. | ||
# Considere que a cobertura da tinta é de 1 litro para cada 6 metros quadrados e que a tinta é vendida em latas de 18 litros, | ||
# que custam R$ 80,00 ou em galões de 3,6 litros, que custam R$ 25,00. | ||
#Informe ao usuário as quantidades de tinta a serem compradas e os respectivos preços em 3 situações: | ||
#comprar apenas latas de 18 litros; | ||
#comprar apenas galões de 3,6 litros; | ||
#misturar latas e galões, de forma que o desperdÃcio de tinta seja menor. Acrescente 10% de folga | ||
# e sempre arredonde os valores para cima, isto é, considere latas cheias. | ||
|
||
|
||
|
||
|
||
|
||
import math | ||
|
||
area = float(input('Digite o tamanho em m² de area a ser pintada: ')) | ||
litros = area/6 | ||
litros_com_folga = litros * 1.1 | ||
|
||
lata = int(litros_com_folga/18) | ||
resto = litros_com_folga % 18 | ||
galoes = math.ceil(resto/3.6) | ||
preco = (lata * 80) + (galoes * 25) | ||
|
||
print(f'Misture latas e galões') | ||
print(f'Você precisa de {lata} latas e {galoes} galoes de tinta') | ||
print(f'O preço total é de R$ {preco:.2f}') | ||
|
||
|
||
|
||
#exercicios feito em grupo de estudos |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#Faça um programa, com uma função que necessite de três argumentos, e que forneça a soma desses três argumentos. | ||
|
||
|
||
|
||
|
||
|
||
|
||
def sum_mult(a,b,c): | ||
return a+b+c,a*b*c | ||
sum_, mult = sum_mult(10,20,30) | ||
print(sum_) | ||
print(mult) |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#Faça um programa para uma loja de tintas. O programa deverá pedir o tamanho em metros | ||
# quadrados da área a ser pintada. Considere que a cobertura da tinta é de 1 litro para cada | ||
# 3 metros quadrados e que a tinta é vendida em latas de 18 litros, que custam R$ 80,00. Informe ao usuário | ||
# a quantidades de latas de tinta a serem compradas e o preço total. | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
import math | ||
|
||
area = float(input("Digite a área a ser pintada em m² ")) | ||
litros = area/3 | ||
latas = math.ceil(litros/18) | ||
preco = latas * 80 | ||
|
||
print(f"Você vai precisar de {latas} latas de tinta") | ||
print(f"O preço total é de R$ {preco:.2f}") | ||
|
||
#exercicios feito em grupo de estudos |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Não está errado, mas porque você usou underline no fim do nome da variável sum_?
Amei o retorno múltiplo da função, mandou bem demais!