Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. def nextFibonacci(ValueArrIndexX, Value1, Value2):
  2. Value3 = Value1 + Value2
  3. if ValueArrIndexX > Value3:
  4. Value1 = Value2
  5. Value2 = Value3
  6. Value3 = nextFibonacci(ValueArrIndexX, Value1, Value2)
  7. return Value3
  8. else:
  9. return Value3
  10.  
  11. def main():
  12. StrValue = input("Input Array of Number : ")
  13. ArrValue = StrValue.split(',')
  14. print('Output:')
  15. for i_index in range(len(ArrValue)):
  16. Value3 = nextFibonacci(int(ArrValue[i_index]), 1, 1)
  17. print(Value3)
  18.  
  19. if __name__ == '__main__':
  20. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement