I\'m looking to compute the sum of the ordinal values of all the characters of the full name string, and will output this sum.
here is what I have so far.
If you only concatenate a
and b
you will get 695
:
print(sum(ord(i) for i in a+b))
# 695
But, it seems you also need a space between the first and last name:
print(sum(ord(i) for i in '{0} {1}'.format(a, b)))
# 727
Simply use a for loop like so num=sum([ord(i) for i in c],0)
assuming c is "Mary Joe" or the string you want. Also, you should use raw_input
if you want the user to give you a string, and for printing use print "your full name is: " + c