Write a dictionary comprehension in python so that the values are square of the key number


Topic: Write a dictionary comprehension in python so that the values are square of the key number

Solution

  
  square_dict = {num: num*num for num in range(1, 11)}
  print(square_dict)
  



List all Python Programs