So what I’m trying to do is make a code that adds the value of the letters in a name e.g. name: ABCD —> 1 + 2+ 3+ 4= 10
My code so far is:
def main():
name = input("Please enter your name (all lowercase): ")
print("\nHere is the code: ")
for ch in name:
print(ord(ch)-96,end=" ")
What I want to do is add all the values of the (ord(ch)-96,end=" ")
You could do this:
Relevant documentation
sumord