SUB.
NAME: PYTHON PROGRAMMING DURATION: 2
HRS
TOTAL
MARKS: 50
PART –A 9*1=9
Q.n
QUESTION
o
1. Which of the following is a valid
variable name in Python?
1
a) 1value b) my-variable c)
value_1 d) class
2. The keyword used for single-line
comment in Python is:
2
a) * b) // c) #
d) /**/
3. Which operator is used for
modulus operation?
3
a) * b) / c) %
d) ^
4 Python was developed by __________.
__________ are reserved words in
5
Python.
An array is a collection of __________
6
of the same type.
7 What is indentation in Python?
8 Mention any two features of Python.
9 Define a literal constant with example.
PART –B 3*7=21
Write a note on the history and features
10
of Python.
Explain the types of Python literals with
11
examples.
Describe the use of input() and print()
12
statements with code snippets.
What are type conversions? Write a Python
13
program that converts float to int.
Define arrays in Python. Write a
14
program to display all elements of an
array.
PART –C 2*10=20
Discuss the various built-in data types in
15
Python with examples.
Write a Python program to create an
16 array and perform any three array
methods.
Explain the types of operators in Python
17
with examples for each.
Answser for one mark
Which of the following is a valid variable name in Python?
1
c) value_1
The keyword used for single-line comment in Python is:
2
c) #
Which operator is used for modulus operation?
3
c) %
4 Python was developed by "Guido Van Rassum"
5 "Keywords" are reserved words in Python.
6 An array is a collection of "Elements" of the same type.
What is indentation in Python?
7 In Python, indentation refers to the spaces at the
beginning of a code line. It determines the block of code.
Mention any two features of Python.
8 Easy to read and write
Open source and portable
Define a literal constant with example.
9 A fixed value in a program.
Example: 25, "Hello", 3.14