LearnPy Hub
← Inheritance & Special Methods problems
Easy

__str__

Write a Book class with title and author whose __str__ returns TITLE by AUTHOR. Read two lines and print the book.

Input

Two lines.

Output

One line.

Sample 1

Input
Gitanjali
Rabindranath Tagore
Output
Gitanjali by Rabindranath Tagore

Sample 2

Input
Clean Code
Robert Martin
Output
Clean Code by Robert Martin
solution.py
Output appears here
__str__ · Python practice problem · LearnPy Hub