Choose the correct syntax for printing values in the same line

(a) print(a,b)

(b) print(a, end=” “,b)

(c) print (a,end=”$”,b)

(d) print(a)print(b) 

 

Answer:

For printing values in the same line the print(  ) method is used along with the end parameter .

The end parameter will have “ “ as the value to leave a space between the 2 values.

So, the correct answer is (b) print(a, end=” “,b)

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo