LS = ["HIMALAYA", "NILGIRI", "ALASKA", "ALPS"]
D = {}
for S in LS:
if len(S) % 4 == 0:
D[S] = len(S)
for K in D:
print(K, D[K], sep = "#")
Output:
HIMALAYA#8
ALPS#4
Explanation:
The list `LS` is `["HIMALAYA", "NILGIRI", "ALASKA", "ALPS"]`.
The program iterates through `LS`. For each string, if its length is a multiple of 4, the string and its length are added to dictionary `D`.
After processing, `D` is `{"HIMALAYA": 8, "ALPS": 4}`.
The program then prints each key-value pair from `D`, separated by `#`.
HIMALAYA#8
ALPS#4