निम्नलिखित पायथन प्रोग्राम का आउटपुट खोजें।
Find the output of following Python Programs.
a= “Meetmeatafterparty”
b= 13
print a+b A
29
B
14
C
error in code
D
15
Explanation
The correct answer is (C) error in code.
In the given Python program, there are two issues:
-
The variable
ais assigned a string value “Meetmeatafterparty”, but it is not enclosed in quotes. This will result in a syntax error. -
The variable
bis assigned an integer value 13.
The
print statement print a + b attempts to concatenate the string value of a with the integer value of b, which is not allowed in Python. This will result in a TypeError.Therefore, the program will not execute correctly, and the output will be an error in the code.
-
-
पायथन में एक स्ट्रिंग (String) और एक पूर्णांक (Integer) को
+ऑपरेटर का उपयोग करके सीधे नहीं जोड़ा जा सकता। यहTypeErrorदेगा।
-
Correct Answer: C) error in code