Advertisement
Zafichi

hw2star

Dec 13th, 2019
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. def foo(first_num, second_num, result):
  2.     print(first_num, end=' ')
  3.     print(second_num, end=' ')
  4.     for i in range(result + 1):
  5.         if first_num + second_num < result:
  6.             next_num = first_num + second_num
  7.             first_num = second_num
  8.             second_num = next_num
  9.             print(next_num, end=' ')
  10.             if first_num + second_num == result:
  11.                 print(result)
  12.                 print('True')
  13.                 break
  14.             elif first_num + second_num < result:
  15.                 continue
  16.             print('\nFalse')
  17.  
  18.  
  19. foo(3, 5, 53316291173)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement