0% found this document useful (0 votes)
9 views3 pages

Python Test

The document contains a series of Python programming questions and answers, covering topics such as operators, comments, data types, and dictionary access. It includes multiple-choice questions about code outputs and Python syntax. The document is structured as a quiz format, likely for educational purposes.

Uploaded by

sunarganesh2682
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

Python Test

The document contains a series of Python programming questions and answers, covering topics such as operators, comments, data types, and dictionary access. It includes multiple-choice questions about code outputs and Python syntax. The document is structured as a quiz format, likely for educational purposes.

Uploaded by

sunarganesh2682
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SIPALAYA INFO TECH Q5. What is the difference between == and is operators in Python?

a) == compares the values of two objects, while is compares their


SUBJECT: PYTHON memory addresses
TIME:1 hr DATE:2025/08/26 b) == compares the memory addresses of two objects, while is
F.M.:20 P.M.:15 compares their values
c) == is used for assignment, while is is used for comparison

[Link] will be the python valid comment? d) == is used for identity testing, while is is used for value testing

a) <! --- > b) # Q6. Output of following statement:

c) // d) /* */ Print(“a”+”bc”)

Q2. What will this code print? a)a+bc b)abc

print(bool("False")) c)ab+c d)None

a) False b)True
c) None d) Error
[Link] of the following operator is correct option for power (ab)? [Link] correct answer of print(12|13)

a) a^b a)13 b)12

b) a**b c)-13 d)-12

c) a *^b
d) a^*b [Link] is the output of

Q4. What is the output of set([1, 2, 3]) & set([2, 3, 4])?

a) {1, 2, 3, 4} b) {2, 3} Print(type([]))

c) {1, 4} d) {1, 2, 3} a) <class 'list'> b) <type 'list'>

c) list d)[]
[Link] is the output of 2*3**3//4 ?
a)13 b)18 Q13. How do you access the value associated with the key 'key'
in a dictionary named my_dict?
c)54 d)12
a) my_dict['key']
Q10. What is the output of?
b) my_dict.key
print(0.1 + 0.2 == 0.3)
c) my_dict(key)
a)True b)False
d) my_dict(key='key')
c)Error d)None
Q14. What will be output of the following code :
Q11. what will be output of the following code:

a=1
print({1, 2, 3} == {3, 2, 1})
while True:
a)True b)False
if a % 7 = = 0:
c)None d)Error
break
Q15. What happens when '2' == 2 is executed?
print(a)
a)False b)Ture
a += 1
c)ValueError occurs d)TypeError
a)1 2 3 4 5 6 7 b)1 2 3 4 5 6
c)1 2 3 4 5 d)error
[Link] ?
y=8
Q12. What is Python?
z = lambda x : x * y
a) A high-level programming language
print(z(6))
b) A type of snake
a)48 b)error
c) An operating system
c)14 d)None of these
d) A database management system
Q17. What will be the output: Q19. Which one of the following is not a keyword in Python
d = {1 : 1, 2 : '2', '1' : 1, '2' : 3} language?
d['1'] = 2
a) pass b) eval
print(d[d[d[str(d[1])]]])
c) assert d) nonlocal
a)2 b)3
c)’2’ d)error

Q18. Output Q20. What will be the output ?


x = 10 x=5
def outer():
y = 10
x = 20
def inner(): x, y = y, x + y
nonlocal x
print(x, y)
x = 30
inner() a) 5, 15 b) 10, 15
return x
c) 15, 10 d) Error
print(outer())

a)10 b)20
c)30 d)Error

You might also like