def print_phylip(source_dict):
    """Print phylip-formatted string from {taxon: seq} dict."""
    taxa_list = list(source_dict.keys())
    no_taxa = len(taxa_list)
    pad_longest_name = len(max(taxa_list, key=len)) + 3
    seq_length = len(next(iter(source_dict.values())))
    header = str(len(source_dict)) + ' ' + str(seq_length)
    phylip_string = header + '\n'
    for taxon, seq in sorted(source_dict.items()):
        taxon = taxon.replace(' ', '_').strip("'")
        phylip_string += taxon.ljust(pad_longest_name, ' ') + seq + '\n'
    return phylip_string
