Hi everyone! I'm a student taking an introduction to Python programming class and I'm in URGENT need of some help!

Basically the program I need is to compute the "numeric value" of a name. Ex. a = 1, b = 2, c = 3, etc. So name abc = 6.

I'm to capitalize the name before I compute the letters also.

I should mention that the program can't be too complicated yet because we're only on chapter 4 of this book :http://www.amazon.com/Python-Programming-Introduction-Computer-Science/dp/1887902996

I'm not sure if it has anything to do with splitting the name as a string. I'm really completely lost on this and some help would be GREATLY appreciated!

Recommended Answers

All 2 Replies

There's no need to split the string, just simply iterate over it and perform your counting. To make a string upper case use the upper function.

Try this

st='abcde'
count = 0
for i in st :
       i = i.capitalize()
       count = count + ord(i) - 64

print count
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.