Advertisement
roronoa

dérivée cos et sin fonctionnel (pas de moi)

Jul 15th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. n=int(input())
  2. p=input()
  3. f=p[0:3]
  4. C=p[4:-1]
  5. c=1
  6. if C:c=int(C)
  7. b=1
  8. for x in[0]*n:
  9.  b=b*c
  10.  if f=="sin":f="cos"
  11.  else:
  12.   f="sin"
  13.   b=-b
  14. if b==1:b=""
  15. elif b==-1:b="-"
  16. else:b=str(b)
  17. print(b+f+" "+C+"x")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement