I really need help to make the below code calculate the numeric value for each name separately.
for example: if i enter "Williams smith", it will calculate the first name and give its value alone and calculate the second name and give its value too. the code right now gives only the total value for the complete name.
thanks in advance
def main(): print "This program calculates a numeric value for a name.\n" name = raw_input("Please enter your first or last name (no spaces): ").lower() print "\n","-"*10 total = 0 for ch in name: total += ord(ch)-96 print ch,"=",ord(ch)-96 print "-"*10,"\n",name,"=",total main ()