PYTHON 2023-24 Even Sem
PYTHON 2023-24 Even Sem
BTECH
(SEM IV) THEORY EXAMINATION 2023-24
PYTHON PROGRAMMING
TIME: 3 HRS M.MARKS: 70
Note: 1. Attempt all Sections. If require any missing data; then choose suitably.
SECTION A
4
19
SECTION B
92
5.
_2
.6
P2
40
b. Explain how to define a list in Python. Write a Python program to remove
4E
.2
duplicates from a list and print the resulting list.
15
P2
c. Explain the concept of functions in Python. Write a function that takes a list of
|1
Q
numbers and returns the sum of all the numbers in the list.
PM
d. Write a Python program to read a file named “ABC.txt” and count the number
of lines, words, and characters in the file.
e. Explain the basic usage of matplotlib for plotting graphs. Write a Python
02
program to plot a simple line graph showing the relationship between x = [1, 2,
:
40
SECTION C
24
(a) Explain for and while loops used in Python with appropriate example.
g-
(a) Write a program takes two strings and checks common letters in both the
|0
strings.
Enter first string: Hari
Enter second string: Hale
The common letters are:
H
a
(b) Write a Python Program to find the sum all the items in a dictionary.
For example if d={'A':100,'B':540,'C':239}then output should be 879.
1|Page
QP24EP2_292 | 07-Aug-2024 1:40:02 PM | 115.240.65.194
Printed Page: 2 of 2
Subject Code: BCC402
0Roll No: 0 0 0 0 0 0 0 0 0 0 0 0 0
BTECH
(SEM IV) THEORY EXAMINATION 2023-24
PYTHON PROGRAMMING
TIME: 3 HRS M.MARKS: 70
4
a DataFrame from a dictionary and print it.
19
92
5.
_2
.6
P2
40
4E
.2
15
P2
|1
Q
PM
:02
40
1:
24
20
g-
Au
7-
|0
2|Page
QP24EP2_292 | 07-Aug-2024 1:40:02 PM | 115.240.65.194