Check sibling questions

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)

  1. Computer Science - Class 11
  2. Chapter 5 Class 11 - Getting started with python

About the Author

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