0% found this document useful (0 votes)
45 views3 pages

Py 6

Python notes

Uploaded by

Pavan SB
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views3 pages

Py 6

Python notes

Uploaded by

Pavan SB
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

(Page 1 of 1)

USN 18CS34
B. E. Degree (Autonomous) Third Semester End Examination (SEE)

PYTHON PROGRAMMING
(Model Question Paper – I)
Time: 3 Hours] [Maximum M
Instructions to students:
Answer FIVE FULL questions

RBT
Q.No. Questions Marks CO Cognitive
Level
Describe Arithmetic Operators, Assignment Operators,
a) Comparison Operators, Logical Operators and Bitwise 10 CO1 L2
Operators in detail with examples.
Explain the Identifiers, Keywords, Statements,
1.
b) Expressions, and Variables in Python programming 5 CO1 L2
language with examples.
Explain the basic data types available in Python with
c) 5 CO1 L2
examples.
OR
Write Python Program to reverse a number and also
a) find the Sum of digits in the reversed number. Prompt 8 CO1 L3
the user for input.
2. Write Pythonic code to check if a given year is a leap
b) 6 CO1 L3
year or not.
Write Python program to find the GCD of two positive
c) 6 CO1 L3
numbers.

Write Python code to determine whether the given


a) 6 CO2 L3
string is a Palindrome or not using slicing.
Explain the use of join() and split() string methods with
3. b) examples. Describe why strings are immutable with an 6 CO2 L2
example.
Write Python program to count the total number of
c) 8 CO2 L3
vowels, consonants and blanks in a String.
OR
4. Write Python program to add two matrices and also
a) 7 CO3 L3
find the transpose of the resultant matrix.
Input five integers (+ve and −ve). Write Pythonic code
to find the sum of negative numbers, positive numbers
b) 7 CO3 L3
and print them. Also, find the average of all the
numbers and numbers above average.

Dr. Ambedkar Institute of Technology, Bengaluru – 560056


(An Autonomous Institution Affiliated to Visvesvaraya Technological University, Belgaum)
(Page 2 of 2)
Write Pythonic code to find Mean, Variance and
c) 6 CO3 L3
Standard Deviation for a list of numbers.

Discuss the relation between tuples and lists, tuples


a) 8 CO3 L2
and dictionaries in detail.
Write Python program to swap two numbers without
5. b) using Intermediate/Temporary variables. Prompt the 6 CO3 L3
user for input.
Write a program that accepts a sentence and calculate
c) 6 CO3 L3
the number of digits, uppercase and lowercase letters.
OR
Write Pythonic code to sort a sequence of names
a) according to their alphabetical order without using 8 CO3 L3
sort() function.
6. b) Discuss zip() function with an example. 6 CO3 L2
Illustrate the following Set methods with an example.
c) a) intersection() b) union() c) issubset() d) difference() 6 CO3 L2
e) update() f) discard()

Discuss the following special characters in detail.


a) 7 CO4 L2
a) \d b) \w c) \b d) {m, n} e) \ f) ?
Consider the file structure given below. Write Python
program to delete all the files and subdirectories from
the Extinct_Animals Directory.
b) 6 CO4 L3
7.

Describe the difference between Python os and os.path


modules. Also, discuss the following methods of os
c) 7 CO4 L2
module
a) chdir() b) rmdir() c) walk() d) listdir() e) getcwd()
OR
a) Describe the characteristics of the CSV format. 7 CO4 L2
Write Python program to write the data given below to
a CSV file.
Category,Winner,Film,Year
Best Picture,Doug Mitchell and George Miller,Mad Max:
Fury Road,2015
b) Visual Effects,Richard Stammers,X-Men:Days of Future 7 CO4 L3
8. Past,2014
Best Picture,Martin Scorsese and Leonardo
DiCaprio,The Wolf of Wall Street,2013
Music(Original Song),Adele Adkins and Paul
Epworth,Skyfall from Skyfall,2012
Discuss the following methods of os.path module.
c) a) isfile() b) abspath() c) relpath() d) dirname() e) 6 CO4 L2
splitext() f) getmtime()

Dr. Ambedkar Institute of Technology, Bengaluru – 560056


(An Autonomous Institution Affiliated to Visvesvaraya Technological University, Belgaum)
(Page 3 of 3)

Write Python Program to Calculate Area and


a) 10 CO5 L3
Perimeter of different Shapes using Polymorphism.
9.
Illustrate the diamond problem in Python programming
b) 10 CO5 L2
language with an example.
OR
Write Python Program to Demonstrate the Construction
a) 10 CO5 L3
of Method Resolution Order in Python.
10 Consider a Rectangle Class and Create Two Rectangle
. Objects. Write Python program to Check Whether the
b) 10 CO5 L2
Area of the First Rectangle is Greater than Second by
Overloading > Operator.

******

Dr. Ambedkar Institute of Technology, Bengaluru – 560056


(An Autonomous Institution Affiliated to Visvesvaraya Technological University, Belgaum)

You might also like