Enter Python in the interactive mode. You should see a message
In [1]:
Complete the following calculations by filling in the blanks:
In [1]: 1 + ___
Out[1]: 3
In [2]: 12 ___ 8
Out[2]: 4
In [3]: ___ * 5
Out[3]: 20
In [4]: 21 / 7
Out[4]: ___
In [5]: ___ ** 2
Out[5]: 81
Enter the commands to see what happens (do not type the first part In [1]
etc., these will appear automatically).
Complete the following exercises:
There are more operators in Python. Find out what the following operators do?
3 ** 3
24 % 5
23 // 10
Which of the following Python statements are valid? Try them in the IPython shell.
0 + 1
2 3
4-5
6 * * 7
8 /
9
Which operations result in 8?
-
65 // 8
-
17 % 9
-
2 ** 4
-
64 ** 0.5
In the table, you find the five most popular boys' names from the year 2000. What is the total number of boys in the top5?
name | number |
---|---|
Jacob | 34465 |
Michael | 32025 |
Matthew | 28569 |
Joshua | 27531 |
Christopher | 24928 |