`
>>>backwards('real')
laer
besides I want to print it in uppercase
LAER
`
A well known snippet
>>> 'real'[::-1]
'laer'
>>>
s.upper()
Returns a copy of string s converted to uppercase
Also see ...
http://www.daniweb.com/software-development/python/threads/476338/print-a-string-backwards#post2080599
x = "real"
y = ""
for i in range(len(x)-1, 0, -1):
y.append(x[i])
y = y.upper()
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.