N-lines with the phrase

Advertisements

My task:

Input format:
The first line contains one natural number
The second line contains the necessary phrase.

Output format:
NN lines of the form: I like "<phrase>"!

Here’s what I got:

a = int(input())
b = int(input()) 
for i in range(a):
    print("I like", " ", "\"", b, "\"", "!", sep="")

But my reviewer did not accept this, what can be changed in the code or done in a completely different way?

>Solution :

I think removing the sep argument from the print because the test requires the phrase on different lines (for some reason i thought it was end )

Edit: As shmak and fen1x suggested the second arument is probably a string so using int will break it

a = int(input())
b = str(input()) 
for i in range(a):
    print(f'I like "{b}"!')

Leave a ReplyCancel reply