here is the question. No this is not homework this is self taught.
I am attempting the following question:
The mirror image of string vow is string wov, and the mirror image wood is string boow. The mirror image of string bed cannot be represented as a string, however, because the mirror image of e is not a valid character. The characters in the alphabet whose mirror image is a valid character are: b, d, i, o, v, w, and x. Develop function mirror() that takes a string and returns its mirror image but only if the mirror image can be represented using letters in the alphabet.
**My Code **
def mirror(word):
'''returns mirror image of word but if it can be represented
using letters in the alphabet'''
for i in range (0,len(word)):
if i == 'bdiovwx':
print(str(word.reverse))
else:
print ('NOPE')
the result i am getting is nothing. As in i execute the program and nothing prints.
Any thoughts?
Thank you