Conditional message based on items tag present in cart for shopify

Hi @Marcwales ,

Please change code:

{%- liquid
  assign count_tag = 0
  assign name_tag = ''
  for item in cart.items
    if item.product.tags contains 'A' or item.product.tags contains 'B' or item.product.tags contains 'C' or item.product.tags contains 'D' or item.product.tags contains 'E'
     assign count_tag = count_tag | plus: 1
     assign name_tag = name_tag | append: item.product.tags | append: ';'
    endif
  endfor
  assign size_tag = name_tag | split: ';' %}
-%}

{%- if count_tag > 1 -%}
  Your cart has {{ size_tag.size }} different size ({% for name in size_tag %}Size {{ name }} {% unless forloop.last %}and{% endunless %}{% endfor %}), please check if accurate.
{%- endif -%}