VisuAlg Web

O Canivete Suíço Científico

Aqui usamos funções nativas de Python como abs() , int() e pow() , além do módulo math para trigonometria.

Aqui usamos funções nativas de Python como abs(), int() e pow(), além do módulo math para trigonometria.

Exemplo de códigoPython


n = -5.5

print("Absolute value (ignores minus sign): ", abs(n))
print("Integer part (removes decimals): ", int(n))
print("Squared number: ", pow(3, 2))  # Same as 3 * 3
Exemplo de códigoPython


import math

angle_degrees = 90.0
# We convert degrees to radians before applying the functions
rad = math.radians(angle_degrees)

print("Sine of 90 degrees is: ", math.sin(rad))
print("Cosine of 90 degrees is: ", math.cos(rad))