Report Bug

Qus

What will be the output of the following Python code, if the code is run on Windows operating system?

import sys

if sys.platform[:2]== 'wi'

print("Hello")

Qusयदि विंडोज ऑपरेटिंग सिस्टम पर कोड चलाया जाता है, तो निम्न Python कोड का आउटपुट क्या होगा?


A. Error
B. Hello
C. No output
D. Junk value


Solution
B. Hello



Explanation
The output of the function sys.platform[:2] is equal to ‘wi’, when this code is run on windows operating system. Hence the output printed is ‘hello’.
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad