LearnPy Hub
← File Handling problems
Easy

Read the First Few Characters

Write the first input line to t.txt. Read k from the second line and print what f.read(k) returns.

Input

A line, then k.

Output

One line.

Sample 1

Input
Python
3
Output
Pyt

Sample 2

Input
hello world
5
Output
hello
solution.py
Output appears here
Read the First Few Characters · Python practice problem · LearnPy Hub