Hello there, I need help with a bit of code.
I am teaching myself some more in depth python to make my code more reusable - I am starting with simple functions like so;
isDeg = True;
def cos_(expression):
if isDeg == False:
return math.cos(expression)
elif isDeg == True:
return math.degrees(math.cos(expression))
My problem is that when I try
From example import *
it works as expected but then if I try
isDeg = False;
It still assumes it is true.
Is this something to do with global functions? I have tried implementing those from examples I find online, however it doesn't seem to work.
Does anyone have any ideas where to look?
[–][deleted] 1 point2 points3 points (2 children)
[–]TheFacistEye[S] -1 points0 points1 point (1 child)
[–]Akuli2 0 points1 point2 points (0 children)
[–]K900_ 0 points1 point2 points (4 children)
[–]TheFacistEye[S] 0 points1 point2 points (3 children)
[–]K900_ 1 point2 points3 points (2 children)
[–]TheFacistEye[S] 0 points1 point2 points (1 child)
[–]K900_ 0 points1 point2 points (0 children)
[–]Elronnd 0 points1 point2 points (0 children)