Wednesday, 1 August 2012

String concatenation problem and its fix in Python

When read string from keyboard or file, e.g.
file_date = str(input("Enter file date: "))
It may cause the cursor to go back to the start of the line when you try to print it out. You may want to trim the return value of the string.

For example, STRING_VALUE.rstrip()

No comments:

Post a Comment