Module 4

Combining operations

Chaining multiple string operations.

Chaining methods

You can combine multiple operations. Each method returns a new string, so you can chain them together.

Python
seq = " atgcgca "
clean = seq.strip().upper()
print(clean)
print(clean.count("A"))
ATGCGCA 2
Your task

Combine operations

  • Strip, uppercase, and count A in ' atgcgca '.