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

How Can Influencers Show Glamour and Class Selling on Instagram

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

The Hottest Wearable Tech and Smart Gadgets of 2022 Will Blow Your Mind

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

New Technology Will Help Keep Your Smart Home from Becoming Obsolete

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

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,...

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...