Module 4

Cleaning text

Removing unwanted characters.

Making text consistent

Real data is often messy. The strip() method removes whitespace from the beginning and end of a string.

Python
text = "  ATGC  "
print(text.strip())
print(text.strip().upper())
ATGC ATGC
Your task

Clean text

  • Strip whitespace from ' ATGC ' and convert to uppercase.