0% found this document useful (0 votes)
13 views2 pages

Icp3 PDF

Uploaded by

Iqra Sarwar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Icp3 PDF

Uploaded by

Iqra Sarwar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment

Submitted by:
Roll no: 2022-ME-141
Degree program: BS Mechanical
Engineering
Section: C
Submitted to:
Professor Waseem
Submission date:
13-02-2023
Calculator

def main():
import math
trig = input ('Do you want to calculate sine, cosine, or tangen
t?')
if trig == 'sine' or trig == 'sin':
a = eval (input ('What is the angle measure?'))
result = math.sin (math. radians (a))
print ('The answer is '+str (round (result, 3)))
main()

elif trig == 'cos' or trig == 'cosine':


a = eval (input ('What is the angle measure?'))
result = math.cos (math. radians (a))
print ('The answer is '+str(round (result, 3)))
main ()

elif trig == 'tangent' or trig == 'tan':


a = eval (input ('What is the angle measure?'))
result = math.tan (math.radians (a))
print ('The answer is '+str(round (result, 3)))
main ()
else:
print ('I do not understand')
main ()
main ()

You might also like