Python is a general purpose language. It is built to do task easier and automate things. Lets checkout how much difficult is to write a program in python to solve class 10th trignometry.
If you are not familiar with trignometry or forgot how it works, go through this page.
In trignometry there are tons of formulae, we will try to code them and see the output. We will solve class 10th basic questions of trignometry and further blogs we will try to solve harder problems and go to inverse trignometry.
Question 1: (class 10th ncert exercise 8.1 q.1)

In the given question we are given with perpendicular and base are given. We need to find the value of hypotaneous pythagoras theoram
for first part python code –
# for theta = A
# Given: AB(perpendicular) = 24 cm and BC(base) = 7 cm
base = 7
perpendicular = 24
hypotenuse = (base*base+perpendicular*perpendicular)**0.5
print(hypotenuse)
# to find sin(a), cos(a)
# sin(a) = Opposite side /Hypotenuse
s_a = str(base)+'/'+str(hypotenuse)
# cos_a = Adjacent side/Hypotenuse
c_a = str(perpendicular)+'/'+str(hypotenuse)
print("value of sin A is: ",s_a)
print("value of cos A is: ",c_a)
similarly for 2nd part. let’s move forward to next level !
Question 2: (ncert exercise 8.1 ques 2)

apply the Pythagorean theorem to find QR
# find QR
QP = 12
PR = 13
QR = (PR*PR-QP*QP)**.5
print(QR)
once we have all the three side now we can find the value of tan(P) and cot(R) and substract them
# to find tan P - cot R
# tan (P) = Opposite side /Adjacent side = QR/PQ = 5/12
t_p = str(QR)+'/'+str(QP)
# Cot (R) = Adjacent side/Opposite side = QR/PQ = 5/12
ct_p = str(QR)+'/'+str(QP)
ans = QR/QP-QR/QP
print("the answer of tan(P)-cot(R) is: ",ans)
that it ! this is easy as that. you can also solve other questions similarly By breaking the bigger problem in pieces. If want me to solve more question mail me @ chitranshuharbola@gmail.com or mssg me +918445490989.
hope this solves your problem of “how you can solve trignometry questions using python code” If you have some questions related to coding contact me.
peace