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 contains the strings: ["HIMALAYA", "NILGIRI", "ALASKA", "ALPS"].
The code iterates through each string in LS. If the length of the string is divisible by 4, it adds the string as a key and its length as the value in dictionary D.
The dictionary after execution becomes: {"HIMALAYA": 8, "ALPS": 4}.
Finally, the dictionary keys and values are printed with a # separator.
HIMALAYA#8
ALPS#4
The SELECT statement when combined with \(\_\_\_\_\_\_\) clause, returns records without repetition.
print(16 * 5 / 4 * 2 / 5 - 8)
myStr[:4] extracts the first 4 characters, which are "MISS".myStr[-5:] extracts the last 5 characters, which are "SIPPI"."#" in between, resulting in "MISS#SIPPI".In SQL, the aggregate function which will display the cardinality of the table is \(\_\_\_\_\_\).
print(16 * 5 / 4 * 2 / 5 - 8)
a = 20
def convert(a):
b = 20
a = a + b
convert(10)
print(a)
Select the correct output from the given options:
Fill in the blank:
\(\_\_\_\_\_\_\_\_\) is a set of rules that needs to be followed by the communicating parties in order to have a successful and reliable data communication over a network.