Python Revision

A quick revision on python concepts. Let’s solve all the below questions by recalling what we have learned till now!!!

1. Which of the following declarations is incorrect in python language?

a) xyzp = 5,000,000
b) x y z p = 5000 6000 7000 8000
c) x,y,z,p = 5000, 6000, 7000, 8000
d) x_y_z_p = 5,000,000

2. Which of the following words cannot be a variable in python language?

a) _val
b) val
c) try
d) try

3. Which of the following is not a core data type in Python programming?

a) Tuples
b) Lists
c) Class
d) Dictionary

4. What does pip stand for python?

a) Pip Installs Python
b) Pip Installs Packages
c) Preferred Installer Program
d) All of the mentioned

5. What will be the output of the following Python code?

x = [12, 34] print(len(list(map(int, x))))

a) 2
b) 1
c) error
d) none of the mentioned

6. _____ is used to create an object.

a) class
b) constructor
c) User-defined functions
d) In-built functions

7. How many except statements can a try-except block have?

a) zero
b) one
c) more than one
d) more than zero

8. When will the else part of try-except-else be executed?

a) always
b) when an exception occurs
c) when no exception occurs
d) when an exception occurs in to except block

1 Like

Answers for Quiz
1.c
2.b
3.c
4.b
5.c
6.c
7.b
8.b

  1. b
    2.c,d
    3.c
    4.b
    5.a
    6.b
    7.b
    8.d

1)b
2)a
3)c
4)b
5)a
6)b
7)c
8)c

  1. b
  2. c
  3. c
  4. c
  5. a
  6. b
  7. d
  8. c