Doubt in Week 5 assignment

Hello All

I seek some clarification on this specific question

Write a program to generate a dictionary that contains the number between 1 and n in the form of (key:value)=(x:x2) where n=100

It gives a sample output as follows

If n = 7 then output will be = {0:0, 1:1, 2:4}

What exactly is the relation between n=7 and the output shown above. I understood that we need to build a dictionary form n = 0 to 100 where the key is the number and the value is square of that but did not understand why if n=7, I will print the above ?

Please help

Thanks
Harish

Hi

I think the explanation is like these, the dictionary with values less than the value given , here for n=7, the least square you would get is 4 and in the same way if N=10, then the output would look like {0:0, 1:1, 2:4, 3:9}