Top 20 Multiple Choice Questions for input method in Python

Top 20 Multiple Choice Questions for input method in PythonTop 20 Multiple Choice Questions for input method in Python

Top 20 Multiple Choice Questions for input method in Python

1. Python में input() function का काम क्या है?
a) Screen पर output दिखाना
b) User से data लेना
c) Loop को बंद करना
d) Program को compile करना
उत्तर: b) User से data लेना (Takes input from user)
________________________________________
2. What is the default data type returned by input()?
input() द्वारा लौटाया गया default data type क्या होता है?**
a) int
b) float
c) string
d) bool
उत्तर: c) string
________________________________________
3. इस कोड का output क्या होगा?
python
CopyEdit
x = input(“Enter name: “)
print(type(x))

a) <class ‘str’>
b) <class ‘int’>
c) <class ‘input’>
d) <class ‘char’>
उत्तर: a) <class ‘str’>
___________________________________________
4. अगर यूज़र ने `”123″` input किया, और आप चाहते हैं कि यह number बने, तो क्या करोगे?
a) int(input())
b) float(input())
c) eval(input())
d) उपरोक्त सभी
उत्तर: d) उपरोक्त सभी (Depends on need)
___________________________________________
5. input() को हम किस रूप में प्रयोग कर सकते हैं?
a) Prompt देने के लिए
b) Value लेने के लिए
c) दोनों a और b
d) केवल debugging के लिए
उत्तर: c) दोनों a और b
_________________________________________
6. Is it possible to use `input()` without any prompt message?
क्या `input()` को बिना मैसेज के यूज़ कर सकते हैं?
a) हाँ
b) नहीं
उत्तर: a) हाँ
____________________________________________
7. इस कोड का आउटपुट क्या होगा यदि यूज़र ने “10” और “20” इनपुट किया?
a = input(“Enter first: “)
b = input(“Enter second: “)
print(a + b)
a) 30
b) 1020
c) Error
d) 10 + 20
उत्तर: b) 1020 (क्योंकि दोनों string हैं)
________________________________________
8. Python में multiple inputs एक साथ कैसे लिए जा सकते हैं?
a) Using comma
b) Using split()
c) Using format()
d) Using int()
उत्तर: b) Using split()
________________________________________
9. इस कोड का output क्या होगा?
x = input(“Enter anything: “)
print(x * 2)
यूज़र ने डाला: 5
a) 10
b) 55
c) Error
d) None
उत्तर: b) 55 (string repeat होगा)
________________________________________
10. input(“>> “) क्या करता है?
a) Prompt देता है >>
b) Comment जोड़ता है
c) Output दिखाता है
d) None of the above
उत्तर: a) Prompt देता है >>
________________________________________
11. int(input(“Enter age: “)) में अगर यूज़र “hello” डाल दे तो?
a) 0 मिलेगा
b) “hello” वापस देगा
c) ValueError आएगा
d) Run नहीं होगा
उत्तर: c) ValueError
________________________________________
12. जब आप चाहते हैं कि यूज़र केवल float value डाले, तो आप क्या करोगे?
a) input()
b) float(input())
c) eval(input())
d) str(input())
उत्तर: b) float(input())
________________________________________
13. input() function किस module का हिस्सा है?
a) sys
b) built-in
c) io
d) os
उत्तर: b) built-in
________________________________________
14. input() क्या variable के साथ use हो सकता है?
a) Yes
b) No
c) Sometimes
d) None of These
उत्तर: a) Yes
________________________________________
15. इस कोड से क्या होगा?
n = input(“Name: “)
a) Variable ‘n’ में कुछ भी नहीं जाएगा
b) User से नाम लेगा और n में store करेगा
c) Error देगा
d) input() काम नहीं करेगा
उत्तर: b) User से नाम लेगा और n में store करेगा
________________________________________
16. input() द्वारा लिए गए डेटा को int में convert करने पर error कब आएगा?
a) जब input number हो
b) जब input special characters हों
c) जब input empty हो
d) b और c दोनों
उत्तर: d) b और c दोनों
________________________________________
17. Is input() used in Python 2.x?
Python 2 में input() का व्यवहार कैसा था?
a) Same as Python 3
b) Returns string
c) Acts like eval()
d) Not available
उत्तर: c) Acts like eval()
________________________________________
18. Python में input को को इनमें से कहाँ use कर सकते हैं?
a) while
b) using if-else
c) for
d) उपरोक्त सभी
उत्तर: d) उपरोक्त सभी
________________________________________
19. इस कोड का output क्या होगा?
name = input(“Enter your name: “)
print(“Welcome”, name)
यूज़र ने input दिया: Python
a) Welcome
b) Welcome Python
c) Python Welcome
d) Syntax error
उत्तर: b) Welcome Python

MCQ Questions for Class 11 Computer Science input() in Python

MCQ Questions for Class 12 Computer Science input() in Python


Click Here for Important Question-Answer – Computer

Click Here for Important Question-Answer – Indian Geography

Click Here for Important Question-Answer – World Geography

Click Here for Important Question-Answer – Indian History

Click Here for Important Question-Answer – Economy


Click Here To Go To Home Page and Get More Knowledge

इसी प्रकार की महत्वपूर्ण जानकारी प्राप्त करने के लिए यहाँ Click करके Whats App Channel पर Follow Button को Select कर सकते हैं

Leave a Comment

x
Scroll to Top