from typing import Union
from datetime import datetime


def _new_name(seq_type: str) -> Union[str, None]:

    """
    Creates a new file name based on the sequence type.
    """

    tstamp = datetime.now().strftime("%Y_%m_%d-%I-%M-%S_%p")

    if seq_type.lower() == "dna":
        return f"dna_sequence_{tstamp}.txt"
    if seq_type.lower() == "rna":
        return f"rna_sequence_{tstamp}.txt"
    print("Invalid sequence type. Choose RNA or DNA.")
    return "Failed!"