KnowledgeBoat Logo

Computer Science

What will be the output produced by following code ?

>>> str(print())+"One"

Python

Python Funda

16 Likes

Answer

Output

'NoneOne'

Explanation

print() function doesn't return any value so its return value is None. Hence, str(print()) becomes str(None). str(None) converts None into string 'None' and addition operator joins 'None' and 'One' to give the final output as 'NoneOne'.

Answered By

8 Likes


Related Questions