خرید بک لینک

Vote count: 0

If I have the names, "johy" and "bobby," how can I use the computer to sort those?

If I compare them to each other numerically it doesn't seem to hold for all conditions.

Consider:

def listsum(numList):
    theSum = 0
    for i in numList:
        theSum = theSum + i
    retu theSum

test = 0
mystr='BA'
for code in map(ord, mystr):
    test = test + listsum([code])
    print(test)

131

and then change,

mystr='AZ'

get 155.

So, I can't just do an ASCII comparison. So what do I use for a basis if I do it manually? I do not want to use any particular language or any built in sort methods.

asked 25 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 5 مرداد 1395 ساعت: 8:06

صفحه بندی