0
Module
#What’s wrong with my code? #Showing no output . from math import cos, sin x=int(input()) def solve_exp(x): y = math.sin(x)-math.cos(x)+math.sin(x)*math.cos(x) return y
2 Réponses
+ 4
You have imported cos & sin from math, so that's all you need to use in the code.
Also, you never called your function
from math import cos, sin
x=int(input())
def solve_exp(x):
y = sin(x)-cos(x)+sin(x)*cos(x)
return y
print(solve_exp(x))
+ 2
It doesn't work in C, maybe that's what's wrong.....
https://www.sololearn.com/discuss/333866/?ref=app