Advertisement
IT45200

Untitled

Aug 20th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. v = int(input("Enter a number: "))
  2. stop = False
  3. k = 1
  4. s = 0
  5. while not stop:
  6.     if s < v:
  7.         k += 1
  8.         s = s + k
  9.     else:
  10.         stop = True
  11.        
  12. print('The min value of K to satisfy 1 + .. + k > V is {0}'.format(k))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement