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#4Explanation: 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
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.
Read the following characteristics of retail trading carefully and choose the correct option:
I. This is concerned with the sale of goods directly to the consumers.
II. Most of the retail trading takes place in fixed establishments or stores.
III. It is formed by many middlemen, traders, and suppliers.
IV. Hawkers, street peddling, automatic vending machines, etc., are its examples.
Read the programmes related to the proposed Bharatmala umbrella scheme carefully and choose the correct option:
I. Backward areas, religious and tourist places connectivity programme
2. To interconnect the four metropolitan cities of the country
3. To develop State roads in adjoining coastal areas
4. To connect non-major ports in coastal states