Skip to content

Commit 77bb109

Browse files
authored
Update README.md
1 parent b6be5f9 commit 77bb109

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

exercises/22-Integral/README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
# `22` Integral
1+
# `22` squares dictionary
22

3-
With a given integral number n, write a program to generate a dictionary that contains (i, i*i) such that is an integral number between 1 and n (both included). Then the program should print the dictionary.
4-
Suppose the following input is supplied to the program:
3+
## 📝 Instructions:
4+
5+
1. Create a function called `squares_dictionary()`. The function receives a number `n` and should generate a dictionary that contains pairs of the form `(n: n*n)` for each number in the range from 1 to n, inclusive.
6+
7+
2. Print the resulting dictionary.
8+
9+
## 📎 Example input:
10+
11+
```py
512
8
6-
Then, the output should be:
7-
{1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64}
13+
```
14+
15+
## 📎 Example output:
816

9-
Hints:
10-
In case of input data being supplied to the question, it should be assumed to be a console input.
11-
Consider use dict()
17+
```py
18+
{1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64}
19+
```

0 commit comments

Comments
 (0)