निम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा?
What will be the output of the following Python code?
sys.stdout.write(' Hello\n')
sys.stdout.write('Python\n')
A
Compilation Error
B
Runtime Error
C
Hello
D
Hello Python
Explanation
The code uses sys.stdout.write() to print text:
sys.stdout.write(' Hello\n')prints " Hello" and moves to the next line because of the\n.sys.stdout.write('Python\n')then prints "Python" and moves to the next line.
Thus, the output is:
Hello
Python
Correct answer: (D) Hello Python
Correct Answer: D) Hello Python