Chapters
Python114 chapters

Exercises

Modules

3 tasks. Write the code, press Check, and the page runs it against a real Python interpreter.

Exercise 1

Import math and print pi and the square root of 16.

Python
# import and print
Exercise 2

Import only sqrt from math, so it can be called without the module name.

Python
# import just sqrt
print(sqrt(9))
Exercise 3

Use Counter from collections to print the two most common letters.

Python
# import Counter and use most_common
print(result)