Python math library - Raspberry Pi Forums


i bought book simon monk called "programming raspberry pi", and
i'm trying learn how programs trig functions , file outputs.
book says math.sin(math.pi/2) return 1.0, example. however,
error indicating math library unknown. ideas i'm
doing wrong?

you missed 1 essential part: have import math module first.

code: select all

import math print math.sin(math.pi/2)


raspberrypi



Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code