feat: Initial commit
This commit is contained in:
32
Laboratorio11/cmqStrings.py
Normal file
32
Laboratorio11/cmqStrings.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from string import printable
|
||||
|
||||
def main():
|
||||
a = list(input("Prima stringa: "))
|
||||
b = list(input("Seconda stringa: "))
|
||||
|
||||
both = set()
|
||||
ina = set()
|
||||
inb = set()
|
||||
nowhere = set()
|
||||
|
||||
for char in printable:
|
||||
ia = char in a
|
||||
iab = char in b
|
||||
|
||||
if ia and iab:
|
||||
both.add(char)
|
||||
elif ia:
|
||||
ina.add(char)
|
||||
elif iab:
|
||||
inb.add(char)
|
||||
else:
|
||||
nowhere.add(char)
|
||||
|
||||
print(both)
|
||||
print(ina)
|
||||
print(inb)
|
||||
print(nowhere)
|
||||
|
||||
|
||||
|
||||
main()
|
||||
Reference in New Issue
Block a user