Advertisement
Guest User

Untitled

a guest
Jan 21st, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. i = 0
  2. sum_all = 0
  3. read1 = ""
  4. inp_min=-20000000
  5. inp_max=20000000
  6. max_count = 40
  7.  
  8. # print "It counts SUM of inputed up to %s integer values from range [%s,%s]. Please use 'Enter' to exit." %(max_count, inp_min, inp_max)
  9.  
  10. while i < max_count:
  11. #    read1 = raw_input("Please enter new value: ")
  12.     read1 = raw_input()
  13.     if len(read1) == 0:
  14. #        print "Exit. '%s' were inputed. The Sum is : '%s' "%(i, sum)
  15.         break
  16.     int1 = int(read1)
  17.     if int1 >= inp_min and int1 <= inp_max:
  18.         sum_all = sum_all + int1
  19.         i = i+1
  20. #    else:
  21. #        print "Entered value '%s' is out in the range of [%s,%s]. Please try again or press 'Enter' to exit" %(int1, inp_min, inp_max)
  22.  
  23. print sum_all
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement