About

Swaroop C H is 29 years of age. He is a coder and startupper. He has previously worked at Yahoo!, Adobe, his own startup and Infibeam.

Read more about him

Views
Personal tools
COLLECTION
Collection

Talk:Python en:Input Output

From Notes

Jump to: navigation, search

suggestion for example using raw_input:

how about:

#/usr/bin/python
#nameReverser -  output the name in reverse order
correctName = raw_input("Please type in your name and press ENTER -->")
tmp = list(correctName)
tmp.sort(reverse=True)
reverseName = ""
for char in tmp:
   reverseName += char
print(reverseName)

Horst --http://www.spielend-programmieren.at 10:31, 30 August 2008 (UTC)

Swaroop said:

Thanks Horst, I took your example and added a little twist in an attempt to make it more 'fun' :)


Horst JENS said:

you'r a genius, Swaroop ! your code is very elegant.