Dictionary Comprehension: Following is the code to create a dictionary where the keys are multiples of 3 among the first 100 natural numbers and each value is the cube of the key.

input_list = list(range(1,100))
output_dict = {}

for val in input_list:
    if val % 3 == 0:
        output_dict[val] = val**3

Now, what would be corresponding dictionary comprehension for the code involved in dictionary creation? 

Tags
programsbuzz banner