Vous êtes sur la page 1sur 4

Centurion University of Technology and Management

Andhra Pradesh

B.Tech 1ST Semester Examination

Python Programming
Max Mark:30 Time:3hrs

INSTRUCTIONS FOR THE SECTION. Like: Total No Number


of to be
Part-A: Answer All the Questions: (20*1=20) Questions answered
in
Section
1 What is called when a function is defined inside a class?
A.Module
B.Class
C.Another Function
D.Method
2 Write output of following code

L1 = list()
L1.append(1)
L1.append(3)
L1.append(4)
print(L1[0],L1[2])

A.1 4
B.1 3
C.1 4 3
D.1 1
3 What is the output of the following?

i=1
while 1!=5:
if i%7==0:
break
print(i,end=' ')
i=i+1

A.123456
B.13579
C.Error
D.False
4 Which tool is used to create basic GUI in python
A.tkinter
B.Pands
C.Numpy
D.Pypy
5 What Will Be The Output Of The Following Code ?

1
class fruits:
def __init__(self, price):
self.price = price
obj=fruits(50)

obj.quantity=10
obj.bags=2

print(obj.quantity+len(obj.__dict__))

A.12
B.52
C.13
D.60
6 What Will Be The Output Of The Following Code ?

x="hello world"
print(x[1:5])

A.ello
B.Hello
C.ello w
D.dlro
7 num = 3
if num==0:
print(num,"is 3.")
print("1",end='')
num = -1
if num > 0:
print(num,"is -1")
print("2")

Output of given code is ____


A.12
B.1
C.21
D.Error
8 Which Of The Following Represents A Template, Blueprint, Or
Contract That Defines Objects Of The Same Type?
A. A class
B. An object
C. A method
D. A data field
9 \a is _____________
A.Alert or Bell
B.Horizontal Tab
C.New Line
D.Carriage Return
10 >>> P=4%5*7+6
>>> P
Output of given code

2
A.34
B.54
C.30
D.50
11 >>>A=”PYTHON”
>>>type(A)
A.<class 'str'>
B.<class 'int'>
C.<class 'float'>
D.<class 'double'>
12 Python Programming Language was created by
A.Guido Van Rossum
B.G Manish Pandey
C.G Ratankumar Singh
D.G Ameer Jha
13 Python 2 version faces official end-of-life ____ Year
A.2021
B.2020
C.2025
D.2023
14 What does the following code do?
f = open("test.txt")
A.Opens test.txt file for both reading and writing
B.Opens test.txt file for reading only
C.Opens test.txt file for writing only
D.Opens test.txt file in god mode
15 Python is __________ based language
A.Compiler
B.Interpreter
C.Assembler
D.Optimizer
16 What is the maximum possible length of an identifier?
A.Unlimited
B.90
C.45
D.56
17 Which Of The Following Keywords Marks The Beginning Of
Function Block?
A. fun
B. define
C. def
D. function
18 Which Of The Following Enclose The Input Parameters Or
Arguments Of A Function?
A. brackets
B. parentheses
C. curly braces
D. quotation marks
19 Function Header part always should contain____________

3
A. Name of Function
B. Name of Function along with Optional Arguments
C. Only Arguments List
D. Only Function Name
20 Function by default return value is called___________
A. None
B. int
C. double
D. public

Part-B: Answer any Five Questions: (2*10=20)


1 Explain features and flavors of python programming 4
2 Write a Python program to count Even and Odd numbers in a List 4
3 A Explain about break and continue statement 2
3 B Define and explain about function recursion 2
4 Write a Python Program to Create a Class which Performs Basic 4
Calculator Operations
5 Define File, Explain about different file modes and methods. 4
6 Write a python GUI program to create Label ,Check Box and Radio Button 4

7 Write a python program to draw Histogram, Bar Plot and Scatter Plot. 4

Vous aimerez peut-être aussi