Q. What is the output of print(‘Hello %s’ % ‘World’)?

A
Hello %s
B
Hello World
C
HelloWorld
D
Error
Solution:

The % operator with %s formats the string, replacing %s with ‘World’.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!