Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. import math
  2.  
  3. i = 0
  4. while( i<3 ) :
  5.     print "x: "
  6.     x = float(raw_input())
  7.     print "y: "
  8.     y = float(raw_input())
  9.    
  10.     # condition 1
  11.     if( x != 0 and (abs(x) > abs(y)) ) :
  12.         z = math.sin((x+y) / y)
  13.         print "z = sin((x+y) / y) = " + str(z)
  14.     # condition 2
  15.     elif( x != 0 and (abs(x) <= abs(y)) ) :
  16.         z = math.arccos(x / y)
  17.         print "z = arccos(x / y) = " + str(z)
  18.     # condition 3
  19.     else :
  20.         print "z = pi = " + str(math.pi)
  21.    
  22.     i = i+1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement