Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

N-lines with the phrase

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>"!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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}"!')
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading