Advertisement
Golden_Rus

Untitled

Dec 13th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import math, sys
  2.  
  3.  
  4. inst = sys.argv[1]
  5. lw = sys.argv[2]
  6. hi = sys.argv[3]
  7. h = sys.argv[4]
  8. inst = inst.replace("sin", "math.sin")
  9. inst = inst.replace("cos", "math.cos")
  10. inst = inst.replace("tan", "math.tan")
  11. inst = inst.replace("sqrt", "math.sqrt")
  12. inst = inst.replace("^", "**")
  13. f = open("output", 'w')
  14. x = lw
  15. while x <=hi:
  16. f.write(x + ' ' + eval(inst)+'\n')
  17. x+=h
  18. f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement