0% found this document useful (0 votes)
43 views

7 Question Bank

The document contains a question bank with multiple choice questions related to Python programming language. There are 30 questions in total with options to choose from for each question. The questions cover topics like the year Python was developed, Python file extensions, defining code blocks in Python, Python keywords, built-in functions, data types and more.

Uploaded by

Quanita Chanda
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

7 Question Bank

The document contains a question bank with multiple choice questions related to Python programming language. There are 30 questions in total with options to choose from for each question. The questions cover topics like the year Python was developed, Python file extensions, defining code blocks in Python, Python keywords, built-in functions, data types and more.

Uploaded by

Quanita Chanda
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Question bank

7th

1) In which year was the Python language developed?

a) 1995
b) 1972
c) 1981
d) 1989

2) Which one of the following is the correct extension of the Python file?

a) py
b) .python
c) ..p
d) None of these

3.Which of the following computer language is written in binary codes only?


a) pascal
b) machine language
c) C
d) C#

4. What do we use to define a block of code in Python language?

a) Key
b) Brackets
c) Indentation
d) None of these

5. Which character is used in Python to make a single line comment?

a) /
b) //
c) #
d) !

6. ࣆWhich of the following language does the computer understand?


a) Computer understands only C Language
b) Computer understands only Assembly Language
c) Computer understands only Binary Language
d) Computer understands only BASIC

7. What is the method inside the class in python language?

a) Object
b) Function
c) Attribute
d) Argument

8. Which of the following declarations is incorrect?


a) _x = 2
b) __x = 3
c) __xyz__ = 5
d) None of these

9. Why does the name of local variables start with an underscore discouraged?

a) To identify the variable


b) It confuses the interpreter
c) It indicates a private variable of a class
d) None of these

9.Who is the father of Computers?


a) James Gosling
b) Charles Babbage
c) Dennis Ritchie
d) Bjarne Stroustrup

10. Which of the following is not a keyword in Python language?

a) val
b) raise
c) try
d) with

11. Which of the following statements is correct for variable names in Python language?

a) All variable names must begin with an underscore.


b) Unlimited length
c) The variable name length is a maximum of 2.
d) All of the above

12.Which of the following is the smallest unit of data in a computer?


a) Bit
b) KB
c) Nibble
d) Byte

13) Which of the following words cannot be a variable in python language?

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

14 Which of the following functions is a built-in function in python language?

a) val()
b) print()
c) print()
d) None of these

15 round(4.576)ࣆࣆ

What will be the output of this function?

a) 4
b) 5
c) 576
d) 5

16 What is the maximum length of a Python identifier?


a) 32
b) 16
c) 128
d) No fixed length is specified.
17 ࣆWhat will be the output of the following code snippet?

print(2**3 + (5 + 6)**(1 + 1))


a) 129
b) 8
c) 121
d) None of the above.
18 What will be the datatype of the var in the below code snippet?
var = 10
print(type(var))
var = "Hello"
print(type(var))
a) str and int
b) int and int
c) str and str
d) int and str
Hide
19 How is a code block indicated in Python?

a) Indentation.
b) Key.
c) None of the above.
20.ࣆWhich of the following language does the computer understand?
a) Computer understands only C Language
b) Computer understands only Assembly Language
c) Computer understands only Binary Language
d) Computer understands only BASIC

21.What will be the output of the following code snippet?

a = [1, 2, 3]
a = tuple(a)
a[0] = 2
print(a)
a) [2, 2, 3]
b) (2, 2, 3)
c) (1, 2, 3)
d) Error.
Hide
22ࣆ What will be the output of the following code snippet?

print(type(5 / 2))
print(type(5 // 2))
a) float and int
b) int and float
c) float and float
d) int and int
Hide
23 Which of the following types of loops are not supported in Python?

a) for
b) while
c) do-while
d) None of the above
24 Which of the following is the proper syntax to check if a particular element is
present in a list?

a) if ele in list
b) if not ele not in list
c) Both A and B
d) None of the above
Hide
25 As what datatype are the *kwargs stored, when passed into a function?

a) Lists.
b) Tuples.
c) Dictionary.
d) None of the above.
26 What keyword is used in Python to raise exceptions?

a) raise
b) try
c) goto
d) except
27 Which of the following is not a valid set operation in python?

a) Union
b) Intersection
c) Difference
d) None of the above
Hide
28 Which of the following are valid escape sequences in Python?

a) \n
b) \t
c) \\
d) All of the above
Hide
29 Which of the following are valid string manipulation functions in Python?

a) count()
b) upper()
c) strip()
d) All of the above
Hide
30 Which of the following modules need to be imported to handle date time
computations in Python?
a) datetime
b) date
c) time
d) timedate
31 In which language is Python written?

a) C++
b) C
c) Java
d) None of these

32 Who developed Python Programming Language?


a) Wick van Rossum
b) Rasmus Lerdorf
c) Guido van Rossum
d) Niene Stom

33 Which type of Programming does Python support?


a) object-oriented programming
b) structured programming
c) functional programming
d) all of the mentioned

34 Is Python case sensitive when dealing with identifiers?


a) no
b) yes
c) machine dependent
d) none of the mentioned

35 All keywords in Python are in _________


a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

36 Which keyword is used for function in Python language?


a) Function
b) def
c) Fun
d) Define
View Answer
Answer: b

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


a) Tuples
b) Lists
c) Class
d) Dictionary
38 Which of these is the definition for packages in Python?
a) A set of main modules
b) A folder of python modules
c) A number of files containing Python definitions and statements
d) A set of programs making use of Python modules

39 What will be the output of the following Python statement?


1. >>>"a"+"bc"

a) bc
b) abc
c) a
d) bca

40 What are the two main types of functions in Python?


a) System function
b) Custom function
c) Built-in function & User defined function
d) User function
View Answer
Answer: c

41 Which of the following is a Python tuple?


a) {1, 2, 3}
b) {}
c) [1, 2, 3]
d) (1, 2, 3)

42 What is output of print(math.pow(3, 2))?


a) 9.0
b) None
c) 9
d) None of the mentioned

43 Which of the following is the use of id() function in python?


a) Every object in Python doesn’t have a unique id
b) In Python Id function returns the identity of the object
c) None of the mentioned
d) All of the mentioned

44 a structure of statement in a computer language


a)algorithm
b)syntax
c)flowchart
d)process
45.Which of the following can access the server?
a) Web Client
b) User
c) Web Browser
d) Web Server
46.A __________it check whether the condition is true.
a) For loop
b) While loop
c) Do while loop
d) Non of these
47. A ___________ is a feature in python that acts as a blank drawing board.
a) Canvas
b) Turtle
c) Define function
d) Import
48.ࣆWhich of the following is a type of technique in which dumb terminals are connected to
a central computer system?
a) Time Sharing
b) Message passing
c) Batch environment
d) User environment
49.Which of the following is not a type of computer on the basis of operation?
a) Digital
b) Analog
c) Hybrid
d) Remote
Which of the following type of computer is mostly used for automatic operations?
a) analog
b) digital
c) hybrid
d) remote
1)WHAT IS PYTHONE

ANS)PYTHONE IS A PROGRAMING LANGUAGE

2)List out five programming Languages that you're aware of?

Ans : Python, C, C#, C++, Java

3)What is an operator?

Ans: Operators in Python are special symbols for carrying out arithmetic or logical calculations

4)Why do we need to learn the Python language?

Ans: Python is user-friendly and it is easier to write codes using Python rather than C++ and
Java. 2. What are the advantages of the Python language? Ans: Advantages of Python: o High-
level language o Interactive

5What is Data Structure?


Ans: Data structures, as the name suggests, are structures that store data! In other words, it is a
structure that stores some related data

6. What is a list?
Ans: Lists are used to store multiple items in a single variable

7. What is a dictionary?
Ans: Dictionary in Python is an unordered collection of data values, dictionaries are used to
store data values in key: value pairs.
8. What is turtle Programming?
Ans: Turtle is a feature in python that act as a Blank drawing Board. Turtle act like a pen.
Q.NO 2) Brief Ans

1.What is a programming language?

Ans: A programming language is a computer language that is used by programmers


(developers) to communicate with computers. It is a set of instructions written in any specific
language ( C, C++, Java, Python) to perform a specific task.

2.Write a program to print the calendar of 10th month.

ANS) IMPORT CALENDER

YY=2023

MM=10

PRINT(CALENDER,MONTH(MM,YY))

3.How to write program using the “for loop”to display the number?

Ans i)start.ii)create new file iii)type out a for loop setting the range as 40.

iv)allot variable to store the remainder v)type an if condition to check whether the remainder is
0.vi)type out a print statement within the if statement vii) rune module on IDLE .viii)stop.

You might also like