Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 12 lines (11 sloc) 0.314 kb
1 2 3 4 5 6 7 8 9 10 11 12
trinum = [(i*i+i)>>1 for i in xrange(25)]
l = raw_input()
l = eval(l) # since we have read string representation of list
aval = ord('A')
def values(x):
    ss = 0
    for i in x:
        ss += ord(i)-aval+1
    return ss

print "No of triangle numbers are",
print len([i for i in map(values,l) if i in trinum])
Something went wrong with that request. Please try again.