Human: remove whitespace at end of line in. Assistant: 
Here is a Python function to remove whitespace at the end of a line

import re

def remove_whitespace(line):
    """Remove whitespace at end of line"""
    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.