Advertisement
lucast0rres

Lista 3 - 1.31

Apr 30th, 2016
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. #This algorithm was crated by Lucas Pereira Torres de Araujo
  2. #Lista 3 - FUP's Class - 2016.1
  3. #Item 1.31
  4.  
  5. s = 0
  6.  
  7. for i in xrange(1, 4):
  8.     i = float(i)
  9.     if i%2 == 0:
  10.         s -= 1/(i+2) #PAR
  11.     else:
  12.         s += 1/(i+1) #IMPAR
  13.  
  14. print "S =", s
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement