Bài tập Python: Loại bỏ ký tự trùng trong chuỗi

# Loại bỏ ký tự trùng trong chuỗi
def loai_bo_trung_lap(chuoi):
  ky_tu_da_xuat_hien = set()
  ket_qua = ''
  for ky_tu in chuoi:
    if ky_tu not in ky_tu_da_xuat_hien:
      ket_qua += ky_tu
      ky_tu_da_xuat_hien.add(ky_tu)
  return ket_qua

# Nhập chuỗi từ người dùng
chuoi = input("Nhập một chuỗi: ")

# Loại bỏ các ký tự trùng lặp
chuoi_moi = loai_bo_trung_lap(chuoi)

# In chuỗi mới
print("Chuỗi sau khi loại bỏ trùng lặp:", chuoi_moi)

Related articles

Discover the Newest Waterproof Gadgets that Come on Sale

I understand how that could positively effect your body,...

Apple Electronics Climb the List of the Top Gadgets in Forbes Magazine

I understand how that could positively effect your body,...

Customer Engagement Marketing: A New Strategy for the Economy

I understand how that could positively effect your body,...

Television is in Steep Decline Compared to Social Network Marketing

I understand how that could positively effect your body,...

Social Networks Advertising is Important the Future Of Marketing

I understand how that could positively effect your body,...

Case Studies

Content & copywriting

Compass Music Platform

A clothing brand wanted to launch a new e-commerce website that would allow customers to browse and purchase their products online. We developed a...
Content & copywriting

NewsWeek Magazine

A clothing brand wanted to launch a new e-commerce website that would allow customers to browse and purchase their products online. We developed a...
E-commerce development

Beauty & Makeup Shop

A clothing brand wanted to launch a new e-commerce website that would allow customers to browse and purchase their products online. We developed a...