Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- i = 0
- sum_all = 0
- read1 = ""
- inp_min=-20000000
- inp_max=20000000
- max_count = 40
- # 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)
- while i < max_count:
- # read1 = raw_input("Please enter new value: ")
- read1 = raw_input()
- if len(read1) == 0:
- # print "Exit. '%s' were inputed. The Sum is : '%s' "%(i, sum)
- break
- int1 = int(read1)
- if int1 >= inp_min and int1 <= inp_max:
- sum_all = sum_all + int1
- i = i+1
- # else:
- # 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)
- print sum_all
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement