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

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

Mobile Marketing is the Future of E-Commerce, Real-World Study Finds

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

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

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