Skip to content

Commit c8db648

Browse files
committed
doc: add comments
Exercises on modules with comments.
1 parent 562cca7 commit c8db648

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

ex016.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,12 @@
22
import math
33
number = float(input('Enter a value:'))
44
print('The value typed was {} and its entire part is {}.'.format(number, math.trunc(number)))
5+
6+
7+
#16: Crie um programa que leia um número Real qualquer pelo teclado e mostre na tela a sua porção Inteira.
8+
'''import math
9+
numero = float(input('Digite um número com parte fracionária:'))
10+
print(f'O número informado foi {numero} e sua parte inteira é {math.trunc(numero)}')'''
11+
12+
#PT- Treinando o uso de modulos, no caso math.
13+
#EN- Training the use of modules, in this case math.

ex017.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,14 @@
55
adjacent_leg = float(input('Enter the value of adjacente leg of triangle:'))
66
hypotenuse = math.hypot(opposite_side,adjacent_leg)
77
print('The value of opposite side is {} and the value of adjacent leg is {}, its hypotenuse is {:.2f}.'.format(opposite_side, adjacent_leg, hypotenuse))
8+
9+
10+
# 17: Faça um programa que leia o comprimento do cateto oposto e do cateto adjacente de um triângulo retângulo. Calcule
11+
# e mostre o comprimento da hipotenusa.
12+
'''import math
13+
cateto_oposto = float(input('Digite o valor do cateto oposto:'))
14+
cateto_adjacente = float(input('Digite o valor do cateto adjacente:'))
15+
print(f'O cateto oposto é {cateto_oposto} e o cateto adjacente é {cateto_adjacente} logo a hipotenusa é {math.hypot(cateto_oposto,cateto_adjacente):.2f}')'''
16+
17+
#PT- Treinando o uso de modulos, no caso math.
18+
#EN- Training the use of modules, in this case math

ex018.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@
77
print('The value of cosine is {:.2f}'.format(cosine))
88
tangent = math.tan(math.radians(angle))
99
print('The value of tangent is {:.2f}'.format(tangent))
10+
11+
12+
#18: Faça um programa que leia um ângulo qualquer e mostre na tela o valor do seno, cosseno e tangente desse ângulo.
13+
'''import math
14+
angulo = float(input('Digite o valor de um ângulo qualquer:'))
15+
print(f'Se o ângulo é {angulo}º, seu seno é {math.sin(math.radians(angulo)):.2f}, seu cosseno é {math.cos(math.radians(angulo)):.2f} e sua tangente é {math.tan(math.radians(angulo)):.2f}.')'''
16+
17+
#PT- Treinando o uso de modulos, no caso math.
18+
#EN- Training the use of modules, in this case math

0 commit comments

Comments
 (0)