# 给定字符串
text = "Hello|Python|World"

#提取并拼接
parts = text.split("|")          # 分割得到 ['Hello','Python','World']
result1 = parts[0] + " " + parts[2]   # 取第1个和第3个，用空格拼接
print(result1)
replaced =text.replace("Python","AI")    # 将 Python 替换为 AI
result2 = replaced.upper()               # 转换为大写
print(result2)