LearnPy Hub
← Lists problems
Easy

The First n Items

Read a list of integers on the first line and n on the second. Print the first n items as a Python list using a slice.

Input

Two lines.

Output

A Python list.

Sample 1

Input
1 2 3 4 5
2
Output
[1, 2]

Sample 2

Input
7 8 9
3
Output
[7, 8, 9]
solution.py
Output appears here
The First n Items · Python practice problem · LearnPy Hub