Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def nextFibonacci(ValueArrIndexX, Value1, Value2):
- Value3 = Value1 + Value2
- if ValueArrIndexX > Value3:
- Value1 = Value2
- Value2 = Value3
- Value3 = nextFibonacci(ValueArrIndexX, Value1, Value2)
- return Value3
- else:
- return Value3
- def main():
- StrValue = input("Input Array of Number : ")
- ArrValue = StrValue.split(',')
- print('Output:')
- for i_index in range(len(ArrValue)):
- Value3 = nextFibonacci(int(ArrValue[i_index]), 1, 1)
- print(Value3)
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement