an exercise requires me to write a list comprehension (where the keys should be divisible by 2 and in a range 0-10; the value for each key should be equal to the square of the key) that returns the following output.
my_dict = { (write code here) for num in (write code here) if (write code here)}
I have tried the following code but I am obviously making some mistakes.
my_dict = {num**2 for num in range(0,10) if float(num/2)==False}
my_dict
Could any of you help me understand how it should be done?
thank you very much