Alveyworld Inc.
  • Home
  • Apple Basics
  • Join Alveyworld

Here are the problems we all have solved

def xpresents(x):
    num = 0
    sol = 0
   
    while num != x:
            num += 1
            temp = num
   
            while temp != 0:
                    sol += temp
                    temp -= 1
    return sol


for i in range(20):
    print xpresents(i)
Powered by Create your own unique website with customizable templates.
  • Home
  • Apple Basics
  • Join Alveyworld