Advertisement
DerioFT

1101.py

Oct 26th, 2021
643
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. while True:
  2.     M, N = map(int, input().split())
  3.  
  4.     X = min(M, N)
  5.     Y = max(M, N)
  6.  
  7.     if M <= 0 or N <= 0:
  8.         break
  9.  
  10.     else:
  11.         add = 0
  12.         result = ''
  13.        
  14.         for data in range(X, Y + 1):
  15.  
  16.             result += str(data) + ' '
  17.             add += data
  18.  
  19.         print(result + "Sum=%d" % add)
  20.  
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement