<human>:  What is a good Python function to remove whitespace at the end of line.
<bot>: Here is a Python function to remove whitespace at the end of a line

import string

def remove_whitespace(line):
  """Remove whitespace at end of line in a string."""
  return line.strip()

# Enter the line
line = "This is a line with whitespace at end."

# Calling the function
print((remove_whitespace(line)))

#Example Output
# This is a line with whitespace at end.

#Remember to inspect code for bugs.