Use python to input two strings and extract the unique content of string 1

First start the software, because of the mac environment, use Command+N (windows: Ctrl+N) to create a new text-based interactive window, and then Command+S (windows: Ctrl+S) to save the location

Next start editing the code

#两个字符串,提取字符串1独有的内容

str_1=input('请输入第一个字符串str_1:')
str_2=input('请输入第二个字符串str_2:')
list=[]
for i in str_1:
    if (i not in str_2):
        list.append(i)
print(' '.join(list))

After Fn+F5 is running, you can start calculating

 The above is my sharing of grade calculation, I hope you like it. 

Guess you like

Origin blog.csdn.net/m0_74436853/article/details/131032636